v0.3.0
Changed
-
Require Nim v1.4.0.
-
The returned tuple for the
find_declaration()
procedure now includes any
expression node if the declaration involves an assignment. Otherwise, this
field is set tonil
. -
Ranged expressions with
:
is now an infix node. -
Refactored the module graph type (
graph.nim
) and its interface.Parsing a Verilog source file now involves attempting to look up the
declarations of all modules instantiated within. -
Refactored the iterators
walk_ports()
andwalk_parameters()
to simplify
logic in user applications.
Added
- Add module caching. The user has to manage the module cache and location
database and initialize each new module graph with these objects. See
graph.nim:new_graph()
. - Add interface
find_all_drivers()
to simplify extracting driver nodes from
the AST. - Add interface
find_all_ports()
andfind_all_parameters()
. - Add a set for the node types involved in expressions.
- Add the option to specify the start of the search for the various
find_first()
functions. - Add operators
[]
and[]=
to AST nodes. This is shorthand to access the
sequence of sons for nonprimitive nodes, i.e.n[i]
is equivalent to
n.sons[i]
. - Define the
len()
proc for nonprimitive AST nodes. The operation is
equivalent tolen(n.sons)
. - For completeness, performing a declaration lookup with a module instance name
leads back to the instantiation itself. - Add
is_external_identifier()
to the AST API. - Add
find_external_identifier()
,find_module_port_declaration()
and
find_module_parameter_declaration()
to the module graph API. - Add the iterator
walk_port_references()
. - Module declaration nodes now include the leading comment token.
- An include path ending with '**' implies a recursive include.
Fixed
-
Disable colored output when stdout does not lead to a terminal.
-
Fix
find_all_parameters()
always including the parameters declared in the
module body. Like ports, these only get included if the parameter port list is
omitted. -
Fix an issue where the lexer would throw an exception when parsing a decimal
constant larger than 64 bits. -
Hierarchical identifiers like
foo.bar[1].baz[3:0]
are now supported.
Previously, only ranged identifiers was allowed and the scoping syntax with
.
didn't work. -
Fix an issue where operators were not being lexed correctly.
The issue occurred when a an infix operator was immediately followed by a
prefix operator, i.e. not separated by whitespace. Before this fix an
expression likea|~b
would be lexed asa
,|~
andb
instead ofa
,
|
,~
andb
like it should. -
Fix
find_declaration()
not yielding the declaration when the target
identifier is a port reference.
Removed
- Remove AST nodes
NkVariableLvalue
andNkArrayIdentifier
. - Remove special identifier node types like
NkPortIdentifier
and
NkModuleIdentifier
in favor of the genericNkIdentifier
. - Remove
NkParameterAssignment
, useNkAssignment
instead.