Commit Graph

309 Commits

Author SHA1 Message Date
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 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 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 a15b0c735f fix codegen for binop size cast 2021-06-21 15:49:23 -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 108852060e prefix bare generate blocks with conditionals in codegen 2021-06-17 15:27:51 -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 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 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 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 280d3dc5a6 fix codegen for generic interface types 2021-05-25 22:10:33 -04:00
Zachary Snow 315733f293 output unpacked localparam types as typedefs 2021-05-24 23:06:07 -04:00
Zachary Snow 74a10a8e13 fix else branch association in verbose mode 2021-05-23 15:54:49 -04:00
Zachary Snow 801955ffab support for empty port connections 2021-05-21 14:08:12 -04:00
Zachary Snow 12c57ecc24 preprocessor cleanup and extended test coverage 2021-05-06 16:14:41 -04:00
Zachary Snow 2885e21cdd fix handling of preproc conditionals within macros
- preproc reads identifiers unconditionally
- drop leading whitespace for default macro args
- very minor preproc cleanup
2021-05-04 16:19:07 -04:00
Zachary Snow c59334ceb8 allow preproc idents to begin with macro arguments 2021-05-03 17:53:41 -04:00
Zachary Snow 10b30d7d1e detect infinite include loops 2021-05-01 21:12:00 -04:00
Zachary Snow 5cc4dce01f refactor positional binding checking and resolution 2021-04-30 14:10:09 -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 2a4d1cc5a8 more useful error message on bad stmt asgn 2021-04-08 00:42:18 -04:00
Zachary Snow c6dbdd09ca preliminary language support for basic classes 2021-03-22 20:01:38 -04:00
Zachary Snow 38cc25fad6 more test coverage and dead code removal 2021-03-09 15:48:10 -05:00
Zachary Snow 31ebf181bb improved parse errors for certain unmatched tokens 2021-03-06 15:03:04 -05:00
Zachary Snow 77b2f8b6ce improve for decl error messaging 2021-03-05 19:58:44 -05:00
Zachary Snow da07619642 support const declarations of alias types 2021-02-23 16:45:53 -05:00
Zachary Snow 2b9fff78e7 fix indentation inconsistencies 2021-02-19 15:04:23 -05:00
Zachary Snow e9d62e01ad unify type range splitting 2021-02-19 14:50:05 -05:00
Zachary Snow aea2975d66 remove outdated TODOs 2021-02-19 12:24:56 -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 2d7dc00b8d fix concat of based xz literals with uneven chunks 2021-02-15 16:58:56 -05:00
Zachary Snow 465060ce4f fold concatenations of number literals 2021-02-11 17:36:05 -05:00
Zachary Snow dd1a9efb40 refactor cast conversion
- delegate cast type and sign resolution to TypeOf conversion
- internal support for injecting data declarations into statements
- fix size and sign of unbased unsized literals used in casts
- avoid generating many unnecessary explicit casts
- support casts which depend on localparams within procedures
- expression traversal correctly visits types within type casts
- fix typeof on expressions of net types
- handle additional edge cases for unsized integer array patterns
- preserve signedness of implicitly flattened unpacked integer arrays
2021-02-03 16:28:53 -05:00