Commit Graph

57 Commits

Author SHA1 Message Date
Zachary Snow 3dac47da17 Upgrade to GHC 9.6.4 2024-05-01 08:18:05 -04:00
Zachary Snow 2579bc8302 translate input reg to input wire 2023-11-05 11:02:51 -05:00
Zachary Snow f68bf187af refactor event control internals
- event expressions use Expr over LHS
- stricter AST representation of event controls
- property specs use event expressions directly
2022-04-11 17:44:47 -06:00
Zachary Snow 3db72c4c2d logic conversion ignores LHSs in procedural assignment senses 2022-02-15 17:49:50 +01:00
Zachary Snow fd64d4e3f2 remove two unreachable LHS conversion errors 2021-10-09 21:18:44 -06:00
Zachary Snow e42fbfa23c restructure scoper run and eval interface 2021-09-16 23:35:16 -04:00
Zachary Snow 69e66a215e fix inefficiencies in logic conversion
- don't evaluate AST after procedural assignment collection
- don't use State monad during rewrite
- use Writer rather than State for procedural assignment collection
- use Scoper access generation shortcut utility
- cleanup as-patterns and legacy logic
2021-07-13 22:18:03 -04:00
Zachary Snow a6b872bf57 don't pack arrays passed to system tasks
- avoid packing memories used with read mem tasks
- fix detection of $readmem[hb] in logic conversion
2021-07-10 19:42:06 -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 69bc64ed15 remove legacy ordered binding handling in logic conversion 2021-05-31 16:38:29 -04:00
Zachary Snow 1ba5ab2739 size using lhs for reg continuous assignment indirection 2021-04-14 14:31:31 -04:00
Zachary Snow d847fdfaca split phases into sections 2021-02-08 12:42:34 -05:00
Zachary Snow 821b8bc947 fix loop in logic indirection typing 2021-01-26 15:39:41 -05:00
Zachary Snow b22cd210a4 improved portability of logic conversion
- indirect converted reg continuous assignments through wires
- fix typeof for implicitly typed ports
- fix typeof for sized implicitly typed params
2021-01-25 19:23:54 -05:00
Zachary Snow 260a6507eb fix converted constant continuous assignment 2020-11-24 17:27:58 -07:00
Zachary Snow e4135bb896 use strict State and Writer monads 2020-08-11 19:14:18 -04:00
Zachary Snow 5667bdb589 unpacked array conversion supports generate scoped data
- added type class for looking up elements in scoped conversions
2020-07-14 22:59:59 -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 cd8af036a0 logic conversion supports generate block scoping 2020-07-02 22:59:06 -06:00
Zachary Snow 80154feb5e logic conversion notices procedural assignments in tasks and functions 2020-06-25 09:31:39 -07:00
Zachary Snow 2535d689aa fix struct/interface/logic conversion interactions
- interface conversion only waits for type resolution of modports
- typeof conversion resolves struct field accesses
- logic conversion only converts logic data declarations
- struct conversion only converts within modules
- fix nested type traversal order causing premature struct conversion
2020-06-20 22:46:54 -04:00
Zachary Snow 4bebb85c14 refactor interface conversion 2020-06-20 14:39:57 -04: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 cbe0071e43 fix bit param sizing (resolves #94) 2020-06-14 19:45:32 -04:00
Zachary Snow 12be569742 reduce usage of maybe 2020-06-14 15:56:09 -04:00
Zachary Snow 7e20b74147 logic conversion handles shadowing 2020-06-05 21:41:03 -04:00
Zachary Snow b6f4f690e7 support simple bundle interfaces
- fix position modport-to-modport bindings
- inout logics converted to regs become outputs
2020-06-03 20:26:17 -04:00
Zachary Snow 35e75c0604 language support for strengths 2020-03-20 21:13:57 -04:00
Zachary Snow 9694799a23 more consistent procedural assignment support 2020-02-01 15:52:52 -05:00
Zachary Snow dd0eb5981d added source trace comments
- Trace comments cover module items, decls, and stmts
- Added pseudo-lexer to Alex parser for monadic Position production
- Added Position to every DeclToken
- Removed Comment PackageItem
- Added CommentStmt and CommentDecl
- Fixed traversal skipping outer MIAttr ModuleItems
- Generally cleaned up Parser modules
2020-01-30 22:17:17 -05:00
Zachary Snow c1f027e11a $readmemh/$readmemb imply reg (resolves #57) 2019-11-19 23:41:59 -05:00
Zachary Snow eebe41427e language support for final blocks 2019-10-31 20:39:11 -04:00
Zachary Snow 167c65db11 pass through downstream compiler directives 2019-10-10 20:53:49 -04:00
Zachary Snow df3620d3a0 fix premature logic to wire conversion 2019-09-18 23:39:09 -04:00
Zachary Snow 7267f94b0b allow signing on net types (closes #40) 2019-09-16 19:50:30 -04:00
Zachary Snow 5d80c83092 support for module attributes (resolves #39) 2019-09-15 23:17:14 -04:00
Zachary Snow f5d6683422 generalization of array dimension(s) system functions 2019-09-14 12:38:26 -04:00
Zachary Snow d11e898edb Added ParamType decl; combined parameter and localparam under Param 2019-09-09 07:34:43 +02:00
Zachary Snow 04337988cc standardized handling of resolution across source files 2019-04-30 15:44:52 -04:00
Zachary Snow fc3e79ddd0 basic conversion for int, byte, shortint, and longint 2019-04-24 14:00:08 -04:00
Zachary Snow 33dc4b3f88 conversions are applied per-file
- NestTF refactored to cover all package items
- fixed issue where type traverse skipped typedefs
2019-04-23 18:51:39 -04:00
Zachary Snow da38776d73 decls are now package items 2019-04-23 17:12:56 -04:00
Zachary Snow d01df6110b preliminary language support for packages 2019-04-23 15:53:51 -04:00
Zachary Snow 04983b0cd5 fixed off by 1 in logic conversion 2019-04-23 00:33:41 -04:00
Zachary Snow 88579c6d1f logic conversion fixes produced reg-to-output bindings
- generally cleaned up and documented the Logic conversion
- made exprToLHS a shared helper function, now uses Maybe
- ported existing local exprToLHS helpers to the new one
2019-04-22 20:44:35 -04:00
Zachary Snow 55a5443786 logic conversion makes continuous assignments procedural where necessary 2019-04-22 15:10:34 -04:00
Zachary Snow 9a38225b1d several major fixes surrounding packed arrays
- entirely new PackedArray conversion (always flattens)
- typedef and struct correctly order packed ranges when combining types
- Stmt LHS traversal no longer traverses nested statements to avoid double conversion
- Logic conversion applies to `initial` blocks`
- new and modified tests to cover these cases
2019-04-08 21:28:33 -04:00
Zachary Snow 7883e263f9 several conversion bug fixes
- convert default pattern used to fill a vector
- convert Logic in parameter and localparam types
- interface conversion should happen early for type resolution later on
- interface conversion handles renaming of usages of inlined decls
2019-03-31 15:01:10 -04:00
Zachary Snow 5de77ab62d fix function and task input types 2019-03-26 23:51:31 -04:00