Commit Graph

30 Commits

Author SHA1 Message Date
Dennis Potter d8add0d5f2
Add more padding between 'input' and name of reset-signal 2021-11-26 16:52:46 -08:00
Dennis Potter ae83dceb7a
Closes #13: I/O ports are now grouped and are tied to the register the belong to 2021-11-26 16:32:36 -08:00
Dennis Potter 5d3fd14144
Fix bug that prevented descriptions from being generated inserted 2021-11-06 10:57:46 -07:00
Dennis Potter a148e8bbd1 Update link in header to report bugs 2021-10-30 19:37:02 -07:00
Dennis Potter 85f7808362
Closes #4: Add support for hierarchical addrmaps
Every time an addrmap is detected within another addrmap, a new context
will be opened and a separate RTL file will be created.

All addrmaps will have the same bus-wdiget, but it might be possible
that different addrmaps have different maximum regwidths. For that
reason, it was necessary to change the non-generic srd2sv_if_pkg to a
parametrizable interface.

Almost all changes to the templates in this commit are due to name
changes from 'b2r' and 'r2b' to 'widget_if'.
2021-10-27 23:27:29 -07:00
Dennis Potter 1b011ff593
Replace SW Mux Entry by a dataclass, rather than an (unnamed) tuple 2021-10-19 23:58:02 -07:00
Dennis Potter d80224c43d
Do not generate seperate comparisons for cpu interface mux
Rather, use the activate-signals that get generated anyway.
2021-10-19 23:33:59 -07:00
Dennis Potter 4d3f302a54
Add initial support for memory type registers 2021-10-18 23:40:19 -07:00
Dennis Potter e05408e8a1
Add support for inline-comments
It is possible to enable them for:

- fields
- registers
- regfiles
- addrmaps
2021-10-17 00:53:22 -07:00
Dennis Potter d3bfdeb3f0
Buswidth is now variable, based on widest register
Fixes #2.
2021-09-26 21:16:49 -07:00
Dennis Potter fea0019aa8
Replace old 'reg_clk' name by more generic 'clk'
The reason is that the template will always assume that the
bus signals and the registers are synchronous. Designers should
implement possible synchronization logic outside of this block.
2021-09-15 23:42:52 -07:00
Dennis Potter 24d5534037
Add support for external registers
Every single field and every single alias (!) has its own
interface to the surrounding hardware. This is required
to give users the maximum amount of freedom when defining
certain properties in RDL.
2021-09-06 18:48:37 -07:00
Dennis Potter c689190080
Add proper support for rdy & error indication in read multiplexer
The error indication is generated if:
    - A non-existent register gets read
    - An existent register gets read but not a single bit can be
      succesfully read or written. As soon as 1 bit succeeds don't
      return an error.
2021-09-06 00:26:08 -07:00
Dennis Potter 5e4a954a0c
Add _very incomplete_ AMBA 3 AHB Lite widget
This is just a start on the first widget. It is still very limited and
not yet functional in any way.
2021-08-22 20:38:56 -07:00
Dennis Potter 145ac70123
Add email address to MIT license 2021-08-15 14:12:21 -07:00
Dennis Potter 2e22d82146
Add swmod and swacc properties and fix field-range bug 2021-06-27 00:09:28 +02:00
Dennis Potter 95fef548cf
Add header with license and generation information to addrmap 2021-06-26 11:37:56 +02:00
Dennis Potter 695de2d330
Add <<INDENT>> and <<UNINDENT>> helpers to template
This allows a designer to add markers to the template to indicate where
a new level of indentation should start or end. This is apart fromt he
auto-indents caused by "case", "begin", or "{".
2021-06-25 11:33:57 +02:00
Dennis Potter 01a696c2b3
Add default value to mux to prevent an inferred latch 2021-06-25 01:35:55 +02:00
Dennis Potter 31179eeecc
Add get_package_rtl()-method to regfiles 2021-06-24 01:00:36 +02:00
Dennis Potter 32c6fc3c4a
Add read-multiplexer logic
Evaluating every single wire is maybe not the best way to do this, but
it is probably better than writing a very exotic SV construct with
(for-)loops, breaks, and a lot of conditions. Most synthesis tools are
pretty good at recognizing this case-construct and generating a good
mutliplexer.
2021-06-23 01:03:11 +02:00
Dennis Potter 9deb28ce4e
Add initial version of widget-code and fix remaining SV compiler errors
This adds initial support for a dynamic bus-protocol to internal
register logic SHIM. The chosen default protocol at this point is AMBA 3
AHB Lite and the logic is still empty.

    -> TODO: Adding the widget instantiation showed that it is required
    to have a better interface to parametrize ports & signals in the
    YAML. At this point, only a limited set of variables are supported.

Furthermore, all remaining Verilator compilation issues in the field are
resolved. Those were mostly related to non-declared wires and wrongly named
wires.
2021-06-05 15:37:09 +02:00
Dennis Potter f4432f5b49
Add check for uniqueness of enum member names within a scope 2021-06-03 16:46:49 +02:00
Dennis Potter 4f6010eed2
Dump addrmap packages with enums
This commit only adds package supports for addrmaps. It should be
relatively easy to extend this for regfiles in a future commit.

Furthermore, this commit adds support to _disable_ enums.
2021-06-03 12:02:27 +02:00
Dennis Potter 2a3cc9505e
Add support for field_reset and cpuif_reset
These two special kind of resets are now recognized by the compiler and
are propagated to all regfiles, registers, and fields.

Furthermore, every object has a set of resets which will be used to
generate a seperate input section for resets in the addrmap.
2021-05-24 14:42:24 +02:00
Dennis Potter b7c1a12179
Add support for enumeration encoding
Fields that are encoded as enumerations are now recognized by the
application. All relevant information will be saved in the Field Object
and the variables and I/O list will be generated accordingly.

This commit also adds dynamic padding of the I/O and variable lists.

Still lacking is the automatic generation of SV packages.
2021-05-24 11:41:45 +02:00
Dennis Potter 085e2ea2dc
Provide more advanced way of adding internal signals or ports
Now, every snippet of RTL in the YAML file can also hold internal
variables (i.e., signals), input or output ports. Furthermore, the
input/output port lists are replaced by a dictionary to prevent
duplicate entries.
2021-05-23 17:46:48 +02:00
Dennis Potter 8d86010a0a
Tweak default widths of I/O ports 2021-05-15 18:04:43 +02:00
Dennis Potter 4738cbfe6c
Add support for 1 packed and 26 unpacked dimensions in addrmap's I/O 2021-05-15 01:17:06 +02:00
Dennis Potter cecb73f07a
Fundamental changes to the architecture of component classes
All components (e.g., fields, registers, addrmaps) are now children
of a common class Component. This common class has certain common
methods such as get_ports(), get_rtl(), or create_logger().

The AddrMap is now prepared to support alias registers by saving the
registers in a dictionary. That way, registers can easily be accessed
once an alias to a register is found. Furthermore, the addrmap template
is now also loaded from a YAML file. Lastly, the first preparements to
insert ports into the addrmap module are made.

For templates, the indents do not need to be added anymore to the
template. Now, a seperate method will automatically indent the RTL
based on simple rules (e.g., increment indent if `begin` is found).
The CLI also supports settings for the tabs (i.e., real tabs or spaces
and the tab width).

A lot of functionality from the __init__() method of the field class
got reorganized. More logic will be reorganized in the future.
2021-05-15 00:29:59 +02:00