Commit Graph

59 Commits

Author SHA1 Message Date
Zachary Snow d847fdfaca split phases into sections 2021-02-08 12:42:34 -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
Zachary Snow b8759776ca limited progress on typeof signedness
- ensure concats and repeats stay unsigned
- defer unbased-unsized conversion to enable cast semantics
- disable inaccurate folding of binary operations of based numbers
- fix typeof and size cast binop signedness logic
- fix typeof $unsigned and $signed
- test harness allows production of `integer unsigned`
2021-02-01 10:17:50 -05: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 ea56f51d03 support for parameters without defaults 2021-01-21 11:55:23 -07:00
Zachary Snow 5c0f414dfa convert wildcard bindings before interfaces 2020-12-03 11:03:09 -07:00
Zachary Snow 7e2450ea5e conversion to create declarations for implicit nets 2020-09-13 23:35:41 -04:00
Zachary Snow e80db12422 conversion for implicitly variably sized parameters 2020-08-12 21:59:57 -04:00
Zachary Snow 50d6faa9b0 yosys-compatible simple loop jump conversion 2020-07-27 18:50:26 -06:00
Zachary Snow a7673c55fd automatically fix simple declaration order issues 2020-07-08 22:20:40 -06:00
Zachary Snow a0c3112b6c flatten tf blocks with decls 2020-05-05 19:32:37 -04:00
Rupert Swarbrick f5881919c1 Allow exclusion of Assert conversion
Yosys does support some asserts nowadays. Allowing sv2v to not strip
them out means that you can check formal properties without needing
hierarchical references (which Yosys really doesn't cope well with!)
2020-03-16 23:34:05 -04:00
Zachary Snow dd9f040f1f improved handling of genvars 2020-02-23 22:30:17 -05:00
Zachary Snow c876c447e6 fix interface inlining renaming 2020-02-09 22:17:48 -05:00
Zachary Snow 22d6ba4927 support evaluating functions as statements 2020-01-11 21:06:09 -05:00
Zachary Snow 2bd24b6086 expand type operator support 2020-01-11 20:35:51 -05:00
Zachary Snow b58248fc2c support type operator on simple expressions 2020-01-11 16:22:07 -05:00
Zachary Snow fb5fd39388 support for inside expression ranges and wildcards 2019-12-08 17:36:25 -05:00
Zachary Snow c936b39bd2 use system functions for signedness casts 2019-10-20 16:18:18 -04:00
Zachary Snow 8ae89a7bd4 support and convert jumps: break, continue, and return 2019-10-08 23:50:26 -04:00
Zachary Snow 454afa97a3 major array pack and flatten update (closes #48)
- dimensions flattening conversion only flattens packed dimensions
- conversion for packing arrays when necessary (preserves memories)
- added coverage for array with multiple packed dimensions
- test runner no longer forbids multi-dim accesses after conversion
- Decl and subordinate types derive Ord
2019-09-26 23:11:59 -04:00
Zachary Snow c7f51209df remove extraneous explicit unsigned (resolves #45) 2019-09-24 23:35:06 -04:00
Zachary Snow ba4cf805ff preliminary conversion for size casts 2019-09-18 23:39:09 -04:00
Zachary Snow 77b9d2f085 support and conversion for foreach 2019-09-15 16:32:19 -04:00
Zachary Snow 2ca8a022ad support and conversion for -> and <-> 2019-09-15 13:55:40 -04:00
Zachary Snow e27d6920a7 conversion for array query system functions (resolves #37) 2019-09-14 16:46:51 -04:00
Zachary Snow a14d078230 substitution conversion for size casts (closes #27) 2019-09-11 22:52:01 -04:00
Zachary Snow 4de585ec0f initial parameter type conversion 2019-09-11 09:27:18 +02:00
Zachary Snow 41bba1b2f2 generate localparams for all package enums (closes #26) 2019-09-04 20:59:41 -04:00
Zachary Snow af4711a8cf preliminary stream conversion 2019-09-03 23:36:29 -04:00
Zachary Snow d6c932d0fc conversion for block decls with asignments 2019-09-02 13:08:41 -04:00
Zachary Snow 243f773657 convert for loop declarations and assignments to signle assignment (closes #15) 2019-08-30 00:12:01 -04:00
Zachary Snow 1d216a2e0e preliminary ternary substitution simplification 2019-08-28 23:26:12 -04:00
Zachary Snow 1dad3a7502 parse and convert empty function arguments (resolves #17) 2019-08-28 20:29:35 -04:00
Zachary Snow 02ba9e95df remove comments by default; added --verbose flag 2019-08-28 19:48:25 -04:00
Zachary Snow fc3e79ddd0 basic conversion for int, byte, shortint, and longint 2019-04-24 14:00:08 -04:00
Zachary Snow 2d003c6ded conversion for package-scoped tasks, functions, and typenames 2019-04-24 04:01:33 -04:00
Zachary Snow 2aa39289a3 added preliminary package conversion 2019-04-23 20:22:03 -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 c8894cebde random documentation and cleanup 2019-04-23 00:23:32 -04:00
Zachary Snow 05b7bdb99c added conversion which moves top-level tasks and functions into modules 2019-04-22 01:18:25 -04:00
Zachary Snow c5fdf38612 added conversion which adds names to unnamed blocks with decls 2019-04-19 19:08:52 -04:00
Zachary Snow 2ee837f7b0 restore port-decl hoisting for cleaner output 2019-04-09 12:50:56 -04:00
Zachary Snow 6d0f7dd0a7 significantly stronger support, and proper handling of assertions 2019-04-03 19:08:30 -04:00
Zachary Snow c53b39319d added support and conversion handling of the $bits system function
This also entailed further fleshing out the expression traversal helper
to cover expressions in generate blocks, which could, of course, use
$bits.
2019-04-02 00:16:09 -04:00
Zachary Snow 5ea2ec9ddf added conversion for name task and function arguments 2019-04-01 13:16:21 -04:00
Zachary Snow b148117935 fix conversion ordering 2019-03-31 15:57:28 -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 edaff3dcf6 added conversion to make functions and tasks use only one statement 2019-03-26 21:43:27 -04:00
Zachary Snow 7f8c2e336b simple conversion for unbased unsized literals 2019-03-19 13:40:25 -04:00