Commit Graph

1038 Commits

Author SHA1 Message Date
Zachary Snow 11dbf1a46a remove dead code in ubased unsized conversion 2021-07-09 12:45:20 -04:00
Zachary Snow 183580632c restrict unbased unsized bit representation 2021-07-09 12:21:46 -04:00
Zachary Snow 52ccd3d383 additional test coverage for existing logic 2021-07-09 10:34:35 -04:00
Zachary Snow 789afd1bb2 error on size cast with non-integer size 2021-07-09 10:25:18 -04:00
Zachary Snow 1f03c64e9f convert Token to use record syntax 2021-07-08 18:54:48 -04:00
Zachary Snow 91e3ac0fb1 normalize trailing whitespace in escaped identifiers 2021-07-08 17:17:45 -04:00
Zachary Snow 9aa8b7033e fix handling of comments, quotes, and trailing whitespace in macro arguments 2021-07-08 16:30:02 -04:00
Zachary Snow 4c7e9d0353 struct conversion uses simple association lists 2021-07-08 13:58:02 -04:00
Zachary Snow 25fe57f75a fix lexing of whitespace in number literals
In places where an optional space was previously allowed, allow any
number of arbitrary whitespace characters, in line with the spec and
other tools.
2021-07-08 13:53:29 -04:00
Zachary Snow 190c2488cc remove unused typeclass derivations 2021-07-07 22:15:51 -04:00
Zachary Snow 2f860ff220 fix trivial hash collisions
Data.Hashable can produce hashes differing little in their upper bits if
only the last character of the string is changed. Because we were using
the upper bits of the hash in shortHash, this could lead to avoidable
hash collisions. This change includes minor simplification optimizations
which surfaced this collision in the existing struct_ident_scope test.
2021-07-07 20:14:11 -04:00
Zachary Snow a863321dd7 combine handling of concatenation LHSs 2021-07-06 21:20:44 -04:00
Zachary Snow df2524ea21 cleanup license file (no functional change)
With permission from Tom Hawkins, I have updated sv2v's existing BSD
3-Clause license to match the exact text of the standard BSD 3-Clause
license. The wording changes, listed below in full, are entirely
innocuous. The copyright attribution is now simpler. The license heading
and link have been removed from the readme. These changes enable the
license to be appropriately detected by GitHub's license detection tool,
hopefully eliminating any potential confusion about the license in use.

- "author" ==> "copyright holder"
- "his" ==> "its"
- "AUTHORS" ==> "COPYRIGHT HOLDERS AND CONTRIBUTORS"
- "AUTHORS" ==> "COPYRIGHT HOLDER"
2021-07-06 17:26:03 -04:00
Zachary Snow 6381c3e050 minor type cleanup and fixes
- remove outdated flexible partial type eq and show instances
- properly disallow incomplete declarations
- disallow var after net type
- remove unused edge case in InterfaceT representation
2021-07-06 12:12:59 -04:00
Zachary Snow 43883efa5c fix partial packing of multidimensional unpacked arrays 2021-07-05 18:20:41 -04:00
Zachary Snow 5fd21ebfb0 improved parsing in declaration contexts
- support for additional assignment statements in loop initializations
- greatly improved error messaging in these contexts
- decl parser takes in the ending token; significant related refactoring
- pass through elaboration system tasks
- removed non-blocking assignment operator precedence hack
- preliminary nosim test suite for features unsupported by iverilog
2021-07-05 18:00:12 -04:00
Zachary Snow 6ee558b6b9 initial pass improving decl parsing error messages
- all decl tokens are given an accurate starting position
- key grammar productions return token positions to facilitate the above
- helpers for standardized parse error generation
- replaced annoying pattern-matching type argument restrictions
- moving away from dumping raw decl tokens in error messages
2021-07-03 13:23:33 -04:00
Zachary Snow ff0c7b026c properly distinguish nets and variables internally
- new net decl to replace net pseudo-type
- support nets with complex base types, including typenames
- support var declaration type prefix for all data types
- support var as lone type shorthand
- refactor AST representation of strengths
- traversal helpers for treating nets as variables
- use decl traversals where appropriate
2021-07-02 17:59:21 -04:00
Zachary Snow d32c0a1b09 convert logics with initial values to regs, not wires 2021-07-01 23:17:08 -04:00
Zachary Snow 9de4a3c99c simplify type and decl traversals 2021-06-30 19:13:44 -04:00
Zachary Snow 9d7f917608 handle naming and scoping of unnamed generate blocks 2021-06-30 14:24:35 -04:00
Zachary Snow 6e85245118 remove indirection in collectDescriptionsM 2021-06-28 15:55:35 -04:00
Zachary Snow c7375d9016 fix pass-through codegen and parsing issues
- automatic pass-through test suite coverage
- fix codegen for interface based typedefs
- allow declaration of generic interface ports in module body
- fix codegen for comments within for loop initialization
- fix codegen of class param decls
2021-06-25 12:53:03 -06:00
Zachary Snow d95a56286c split out basic suite tests with refs to new core suite 2021-06-25 11:21:47 -06:00
Zachary Snow bb938f1e0b add ability to --pass-through input without conversion 2021-06-25 11:05:49 -06:00
Zachary Snow 3f20055cd6 proper support for static class methods 2021-06-24 22:15:46 -06:00
Zachary Snow afc3ea435b fix interface conversion erroneously renaming colliding pattern names 2021-06-23 21:39:15 -04:00
Zachary Snow a15b0c735f fix codegen for binop size cast 2021-06-21 15:49:23 -04:00
Zachary Snow 7843ff6da3 filter out empty port connections 2021-06-21 15:49:13 -04:00
Zachary Snow dbbf71c65a revised struct pattern representation
- pattern keys now represented as TypeOrExpr
- support for simple integer struct pattern keys
2021-06-20 15:32:12 -04:00
Zachary Snow 6743725cca support partial packing of multidimensional unpacked arrays 2021-06-19 18:45:35 -04:00
Zachary Snow 3955c47e7a support parameterized class items depending on local generate scopes
- previously the overrides for parameterized data types could only
  reference data declarations at the module scope
- their use within procedures is still allowed, but cannot currently
  refer to localparams declared within procedures
- add procedure scope location accessors to allow scoped traversals to
  mark where injected items will end up in advance
2021-06-19 14:46:00 -04:00
Zachary Snow 108852060e prefix bare generate blocks with conditionals in codegen 2021-06-17 15:27:51 -04:00
Zachary Snow 404385b00f allow arbitrary .v output file using -w/--write 2021-06-16 20:31:37 -04:00
Zachary Yedidia 5eef44c8f4 Add file output write mode 2021-06-16 20:31:37 -04:00
Zachary Snow c0cb401abe fix handling of end labels
- disallow using end label alone on blocks
- improved parse error for mismatches
- add label checking for non-block constructs
- allow generate block to have label before begin
2021-06-15 17:47:32 -04:00
Zachary Snow a87ee7c11b additional param type conversion bug fixes
- general refactoring throughout
- improved metrics for dropping unneeded modules
- fix re-visiting a converted instance in the same pass
2021-06-15 16:46:53 -04:00
Zachary Snow 003d4dbc4e param type conversion initial cleanup 2021-06-07 23:39:26 -04:00
Zachary Snow a47afa96b8 don't force int types to be regs 2021-06-05 16:44:56 -04:00
Zachary Snow ecaaec9c00 minor codegen cleanup 2021-06-04 15:38:51 -04:00
Zachary Snow d2a18e01f2 replace integer unsigned with size-32 reg 2021-06-03 21:18:32 -04:00
Zachary Snow 36fcce8934 fix param type default pollution 2021-06-03 20:51:26 -04:00
Zachary Snow 84986cc197 fix errant reordering on cs/ps alias idents 2021-06-03 15:25:21 -04:00
Zachary Snow 24a79ffebe support multi-dimensional modports 2021-06-02 15:36:44 -04:00
Zachary Snow e0e296349a check for unknown named bindings 2021-06-01 13:09:36 -04:00
Zachary Snow e52de9d4a6 remove legacy ordered binding handling in param type conversion 2021-05-31 16:52:57 -04:00
Zachary Snow 69bc64ed15 remove legacy ordered binding handling in logic conversion 2021-05-31 16:38:29 -04:00
Zachary Snow 13c84e4c7a refactor parameter binding resolution
- fix type/expr ambiguity for interface and class parameters
- check for parameter kind mismatch up front
- centralize key logic in ResolveBindings
2021-05-31 14:13:49 -04:00
Zachary Snow 0aa59165a1 fix size of empty strings to be one byte 2021-05-30 22:07:51 -04:00
Zachary Snow a293002ad7 resolve package and class idents within class parameters 2021-05-29 23:25:47 -04:00