Commit Graph

251 Commits

Author SHA1 Message Date
Zachary Snow 0c31936590 maintain explicit padding in unsized number literals 2020-12-10 14:52:43 -07:00
Zachary Snow c39371c48a simplify and optimize lexing 2020-12-10 13:33:06 -07:00
Zachary Snow 2081f6a32a support attributes on port declarations 2020-12-08 11:28:28 -07:00
Zachary Snow 1fd72d878f fix double backtick handling in backtick string 2020-12-04 13:22:38 -07:00
Zachary Snow 091520e4cd allow generate scoped basic subroutine invocations in statement blocks 2020-11-30 20:36:06 -07:00
Zachary Snow 82290b16ee simplify lexer character position lookup 2020-11-27 14:29:59 -07:00
Zachary Snow e471d37e5c preprocessor batch consumption 2020-11-27 12:05:32 -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 ddaa7ff6c6 zero-pad sized integrals no larger than 256 bits 2020-08-09 17:36:25 -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 39519dd439 zero-pad sized integrals smaller than 32 bits 2020-07-23 22:46:19 -06:00
Zachary Snow 359a3de91e parser rejects errant declarations 2020-07-22 21:35:25 -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 d2a0ba0d13 improved handling of number literals
- elaborated literals larger than 32 bits are given an explicit size
- constant folding no longer encodes illegal negative numbers
2020-07-08 21:49:50 -06:00
Zachary Snow 219a57c37b preliminary language support for parameterized class scopes 2020-07-08 17:46:37 -06:00
Zachary Snow 1903bc190d use unbounded integers 2020-07-02 23:33:03 -06:00
Zachary Snow 211e4b0ed8 fix literal casts larger than 32 bits 2020-07-01 23:35:30 -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 64f3067d78 allow dimension shorthand for instance arrays 2020-06-17 22:26:27 -04:00
Zachary Snow 3cfd368bc2 support multi-dimensional instances 2020-06-17 22:18:08 -04:00
Zachary Snow 12be569742 reduce usage of maybe 2020-06-14 15:56:09 -04:00
Zachary Snow b71e0f5346 performance improvements
- removed repetition in dimension query conversion
- removed repetition in package item nesting conversion
- packing item nesting conversion short circuit
- param type conversion doesn't bother renaming non-param type instances
- implement showsPrec for certain expression cases
2020-06-14 09:20:34 -04:00
Zachary Snow 9adb7522e9 improve stmt representation 2020-06-09 21:18:31 -04:00
Zachary Snow 3186afe400 additional expression simplification cases 2020-06-06 23:18:22 -04:00
Zachary Snow 82703834ac constant folding for shifts 2020-06-06 22:45:17 -04:00
Zachary Snow eb93ba67fc integer atom explicit sign cast support 2020-06-06 21:26:14 -04:00
Zachary Snow ae392d4536 fix single bit enum sizing
- single bit localparams retain explicit range
- fix $bits on unsized literals
- use Implicit over Maybe for underlying type
2020-06-05 21:32:02 -04:00
Zachary Snow 790312d25d vim modelines for Lex.x and Parse.y 2020-05-06 19:03:32 -04:00
Zachary Snow c5ef5ea9e2 additional expression simplification
- constant folding supports hex numbers
- simplify mod
- simplify pow
- elaborate !(a == b) into a != b
2020-04-05 23:12:54 -04:00
Zachary Snow 543a104683 upgrade to stackage lts-14.26 2020-04-05 13:45:31 -04:00
Zachary Snow b8d512e31f remove unneeded imports 2020-04-05 13:45:22 -04:00
Zachary Snow bcafef8d01 allow empty list_of_parameter_assignments 2020-03-30 19:27:44 -04:00
Zachary Snow 1687b1c5c1 allow empty parameter_port_list (resolves #83) 2020-03-25 23:55:19 -04:00
Rupert Swarbrick 78f3db8803 Fail more gracefully on mismatched `if/`elsif/`else/`endif
Without this patch, a stray `endif caused sv2v to take the tail of an
empty list. Now we raise a lexical error.

To do this, the patch pulls the "push" and "pop" logic for the
preprocessor condition stack into separate helper
functions (pushCondStack and popCondStack). It also defines some
helper functions for manipulating Cond's.

The patch also adds a documentation comment explaining what the
different values of Code meant (because I had to squint to work it
out).
2020-03-23 20:19:25 -04:00
Zachary Snow 35e75c0604 language support for strengths 2020-03-20 21:13:57 -04:00
Zachary Snow bd68ab0852 faster parsing of very long files 2020-03-20 18:53:06 -04:00
Zachary Snow f44e3e808a add option to skip preprocessing 2020-03-18 20:02:20 -04:00
Zachary Snow dd9f040f1f improved handling of genvars 2020-02-23 22:30:17 -05:00
Zachary Snow db4c396389 minor multi-packed verbosity improvement 2020-02-17 17:31:14 -05:00
Zachary Snow ad21277eb5 support macro names comprised of macro args and macros 2020-02-16 22:18:12 -05:00
Zachary Snow 463cdcb2c1 support complex sizes in size casts (resolves #69) 2020-02-15 16:48:09 -05:00
Zachary Snow b124a561f2 updated binary and unary operator printing (resolves #72) 2020-02-15 14:11:17 -05:00
Zachary Snow 104f98011e support for string literals with macros
- adds support for using macros and macro arguments within the argument
  list to other macros
- fixes an issue where macros with arguments would have extraneous
  whitespace
- fixes handling of multiline string literals
2020-02-12 23:58:41 -05:00
Zachary Snow df4244d8d5 more aggressive expression simplification 2020-02-09 20:03:08 -05:00
Zachary Snow 14644cd1ed fix output of empty generate loops 2020-02-09 14:01:05 -05:00
Zachary Snow fc9999aeea support implied port directions 2020-02-08 22:48:21 -05:00
Zachary Snow 4b3b09d2db allow extraneous semicolons in generate blocks 2020-02-08 22:15:35 -05:00