Commit Graph

184 Commits

Author SHA1 Message Date
Zachary Snow 581a7911de support for deferred immediate assertion statements 2021-08-16 17:50:23 -06:00
Zachary Snow 30acc3e3f9 fix spacing of as-patterns for future GHC upgrade 2021-08-12 16:13:12 -06:00
Zachary Snow 306d71334b refactor sizing and truncation of integer literals
- use iverilog's -gstrict-expr-width throughout test suite
- add warnings for excess bits or padding zeroes in number literals
- add new --oversized-numbers parameter to retain support for unsized
  numbers wider than 32 bits
- localized use of oversized numbers to new truncate test suite which
  verifies the behavior of both modes, and compares against the known
  behavior of iverilog
2021-08-09 22:10:29 -06:00
Zachary Snow 56c597e35e support explicitly typed struct patterns 2021-07-19 11:42:36 -04:00
Zachary Snow d6d3938d20 fix codegen for assertion property and sequence expressions
- updated representation and added codegen for sequence match items
- fix incorrect codegen for `iff` property expression
2021-07-16 09:54:05 -04:00
Zachary Snow bfd0cee0dc improved handling of procedural for loops
- convert loops with no or many incrementations
- restrict AST node to only contain traditional initializations
- parser elaborates for loop decls into a synthetic block
- decl list codegen is now specific to parameter decl lists
- update jump conversion special cases for new representation
- first experiments with bimapM
2021-07-14 15:50:12 -04:00
Zachary Snow ac548cacfc improved source position trace comments
- remove needless comments generated during interface conversion
- filter null statements even in verbose mode
- hoist trace comment statements if doing so would prevent the need to
  wrap a task or function body in a block
- add traces for global declarations
- add traces for parameter declaration lists
- add traces for module items within generate blocks
- avoid generating duplicate traces before declarations
2021-07-11 20:43:30 -04:00
Zachary Snow 3eefd03c8d additional declaration parsing errors
- general refactoring in decl parsing
- restrict charge strength to trireg
- require const vars to be initialized
- forbid const net declarations
- disallow run-on declarations in packages and classes
2021-07-09 15:41:17 -04:00
Zachary Snow a863321dd7 combine handling of concatenation LHSs 2021-07-06 21:20:44 -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 9d7f917608 handle naming and scoping of unnamed generate blocks 2021-06-30 14:24: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 3f20055cd6 proper support for static class methods 2021-06-24 22:15:46 -06: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 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 0a65abd614 full support for package and class subroutine invocations 2021-05-29 22:34:03 -04:00
Zachary Snow c0282862ea error if procedural block has a decl after a stmt 2021-05-29 21:55:50 -04:00
Zachary Snow 801955ffab support for empty port connections 2021-05-21 14:08:12 -04:00
Zachary Snow ba270acb0e forbid mixing ordered and named port or param bindings 2021-04-29 15:32:54 -04:00
Zachary Snow 5a8801a45f allow trailing commas in parameter and port lists and bindings 2021-04-23 16:17:18 -04:00
Zachary Snow cfff359b51 isolate parse state abstraction 2021-04-20 19:47:55 -04:00
Zachary Snow ecee8b3358 support for interface based typedefs 2021-04-15 11:35:20 -04:00
Zachary Snow c0b8ba17de simplify interface port type representation 2021-04-13 10:45:26 -04:00
Zachary Snow 5f26e755c9 preserve implicitness of task and function ports 2021-04-10 20:45:40 -04:00
Zachary Snow dce7f14909 fix precedence of non-blocking assignment 2021-04-08 17:04:28 -04:00
Zachary Snow c6dbdd09ca preliminary language support for basic classes 2021-03-22 20:01:38 -04:00
Zachary Snow 31ebf181bb improved parse errors for certain unmatched tokens 2021-03-06 15:03:04 -05:00
Zachary Snow da07619642 support const declarations of alias types 2021-02-23 16:45:53 -05:00
Zachary Snow ec766657a8 simplify value range representation 2021-02-17 17:12:57 -05:00
Zachary Snow 4bfcfe4b28 module item attrs aren't mapped onto trace statements 2021-02-17 13:35:10 -05:00
Zachary Snow 0d095e6afb updated case inside representation 2021-02-17 13:29:44 -05:00
Zachary Snow 275130e0b0 move package param step to conversion 2021-01-27 16:41:39 -05:00
Zachary Snow b28a3cac0d represent typedefs as localparam types 2021-01-24 10:07:35 -07:00
Zachary Snow 378ede9e1a standardize internal representation of unknown types 2021-01-24 09:55:03 -07:00
Zachary Snow 8eb3a251f7 package conversion overhaul
- full import and export support
- simplify AST representation of import and export
- allow package-scoped identifiers invoked as subroutines
- use scoped name resolution for identifiers in packages
- merge package item nesting conversion into package conversion
- fix handling of colliding enum items in separate modules
- fix visiting enum item exprs in types
2021-01-23 21:54:39 -07:00
Zachary Snow 40df902887 parser production rule for optional assignments 2021-01-21 12:05:44 -07:00
Zachary Snow ea56f51d03 support for parameters without defaults 2021-01-21 11:55:23 -07:00
Zachary Snow 2081f6a32a support attributes on port declarations 2020-12-08 11:28:28 -07:00
Zachary Snow eb908b8db7 fix ordering of and outputs 2020-09-13 23:24:21 -04:00
Zachary Snow e4135bb896 use strict State and Writer monads 2020-08-11 19:14:18 -04:00
Zachary Snow 67466eaa60 major interface conversion update
- module instances with modport bindings are now inlined
- support for modports in generate loops
- support for generic interfaces
- implied modport instance propagation
- add error message for interface instances missing port list
2020-08-08 20:43:47 -06:00
Zachary Snow bf1d9283d7 interpret package parameters as localparams 2020-07-13 18:54:45 -06:00
Zachary Snow d88c516d33 enhanced handling of number literals
- number literals are parsed rather than stored as strings
- fix array query functions used on non-trivial number literals
- more efficient expression simplification recursion
- expanded constant folding scenarios
2020-07-12 15:06:27 -06:00
Zachary Snow 69b2e86aee remove pattern synonyms which introduced excessive overhead 2020-07-09 21:01:18 -06:00
Zachary Snow 219a57c37b preliminary language support for parameterized class scopes 2020-07-08 17:46:37 -06:00
Zachary Snow 8d37db30e5 support complex modport expressions
- modports can use complex expressions
- update interface_infer test for consistency across simulators
- fix interface inlining of implicitly typed data declarations
2020-06-19 20:32:37 -04:00
Zachary Snow 12be569742 reduce usage of maybe 2020-06-14 15:56:09 -04:00
Zachary Snow 9adb7522e9 improve stmt representation 2020-06-09 21:18:31 -04:00