Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[slang] Make string simple type #1049

Merged

Conversation

likeamahoney
Copy link
Contributor

To support such sample from SystemVerilog LRM section 10.9.2:

module top;
   typedef struct {
      logic [7:0] a;
      bit b;
      bit signed [31:0] c;
      string s;
   } sa;
   
   sa s2;
   initial s2 = '{int:1, default:0, string:""}; // set all to 0 except the
                                                // array of bits to 1 and
                                                // string to ""
endmodule

Copy link

codecov bot commented Jul 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.71%. Comparing base (4221f2f) to head (3bca76f).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1049   +/-   ##
=======================================
  Coverage   94.71%   94.71%           
=======================================
  Files         191      191           
  Lines       47656    47656           
=======================================
  Hits        45136    45136           
  Misses       2520     2520           
Files Coverage Δ
source/ast/types/Type.cpp 95.09% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4221f2f...3bca76f. Read the comment docs.

@MikePopoloski
Copy link
Owner

Huh, interesting that the grammar doesn't include string as a simple type even though it seems like it makes sense. The only other use of simple_type is inside casting_type which also explicitly adds string to the list, so this change makes sense to me.

@MikePopoloski MikePopoloski merged commit 3d4ad50 into MikePopoloski:master Jul 8, 2024
15 checks passed
JoelSole-Semidyn added a commit to JoelSole-Semidyn/slang that referenced this pull request Jul 12, 2024
…dev/slang-tidy

* 'master' of https://github.com/MikePopoloski/slang:
  Update CHANGELOG.md
  [slang] Fix PLA task concatenation ascending order (MikePopoloski#1047)
  [slang] Fix PATHPULSE limit values (MikePopoloski#1048)
  Handle recursive parameter definitions via hierarchical reference
  Mark fmt lib headers as system headers to suppress warnings
  Bump dependency versions: fmt and pybind11
  [slang] Make string simple type (MikePopoloski#1049)
  Update README.md (MikePopoloski#1046)
  [slang][port] Fix bugs (MikePopoloski#1043)
  Use [[likely]] / [[unlikely]] replace macro SLANG_LIKELY/SLANG_UNLIKELY (MikePopoloski#1038)
  Add multiple slang-tidy checks and minor fixes in existing ones (MikePopoloski#1040)
  chore: update pre-commit hooks (MikePopoloski#1041)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants