forked from IObundle/py2hwsw
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(csrs): Add regfile to generated CSRs
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: IObundle#33 IObundle/iob-soc#719
- Loading branch information
Showing
3 changed files
with
33 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters