Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parent attribute; Add bit slicing and concatenations in port connections; Add regfile in CSRs and asym FIFOs. #50

Merged
merged 13 commits into from
Oct 3, 2024

Conversation

arturum1
Copy link
Contributor

@arturum1 arturum1 commented Oct 2, 2024

See commits for details.

Used in PR IObundle/iob-soc#953

No longer use python parameters for auto-csrs.
Now the user provides a CSR with the correct "type" ("INTERRUPT",
"FIFO_R", "AFIFO_W", ...), and the scripts will replace this one by the
complete CSRs for the given type.
If user sets a write register with 'log2n_items' > 0, then csrs.py will
generate the regfile inside the csrs module.
All registers from regfile can be read in parallel. A port signal is created for each register in the regfile.
Example, if we create a CSR, named 'reg', with 'log2n_items' = 2, then the following
port signals will be available in the csrs module:
reg_0_wr
reg_1_wr
reg_2_wr
reg_3_wr

If the user creates a CSR with `autoreg = False`, then the regfile is not generated.
The csrs module continues to generate a single port for this
regfile, since the signals come from the CPU, and the CPU can only
address one register at a time.

If the user creates a CSR of type "R" (read register), then the regfile is not
generated. This is because read registers should always be implemented by
user logic. The csrs module only generates wires to read from the user
logic's regfile.

Note 1: If we have `autoreg = True`, and type "RW", then the csrs module will
generate the regfile for the write part, but will continue to have
normal wires for the read part.

Note 2: The user logic can find out which register from the regfile is being addressed
by using the `iob` output port of the csrs module. (The `iob` output port is
always available to user logic, even if csr_if is set to another interface).

Related to issues:
#33
IObundle/iob-soc#719
New FIFOs are created by specifying a single CSR of one of the following types:
- FIFO_R
- FIFO_W
- AFIFO_R
- AFIFO_W

The csrs module will replace this CSR by the corresponding FIFO CSRs,
and will instantiante the FIFO inside the verilog module.

TODO: AFIFOs not working yet; FIFO size not adjustable yet.
…ctions.

Using an optional tuple in the port connection, we can specify the bit
slice for each singal.

Example of modifying bit slice for signals `axi_arlock` and `axi_awlock`
of wire `axi_m`:
"mem_axi_m": ("axi_m", "axi_arlock[0]", "axi_awlock[0]")

Removed auto-bit slicing previously implemented in py2hwsw (was only
used to auto-trim most significant bits).
New bit slice specification in port connections in generic. Now, it also
supports bit concatenations.

Fix verilog warnings in axi2iob generated by csrs.
@jjts jjts merged commit 64ef417 into IObundle:main Oct 3, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants