Verilog RTL II – Memories/Register Blocks
Parameterization, FSM, memories, FIFO, arbiter, interrupts
What you will learn and practise
Complete the stages in order and retain the requested evidence.
Register arrays; RAM/ROM models
Sync/async reads
Address decode and write enable
Config/status registers
W1C and sticky status concepts
1. Register array
2. 8×8 and 16×32 register files
3. ROM
4. Single-port RAM
5. Sync read RAM
6. Address/write-enable decode
7. Config/status/RO/WO/RW regs
8. W1C register
9. Sticky status
10. HW-set/SW-clear
11. Register bank integration
Debug address aliasing and W1C behavior
Mini-project: config/status register block
Register block with read/write tests
Implement synthesizable memory/register structures and a configuration/status register block with correct access behavior.
- Create project_workspace/week3_verilog_rtl2/day13_registers with rtl, tb, sim and logs directories.
- Document addresses and access type for the integrated register bank.
- Test both valid and boundary addresses.
- Implement a register array and 8x8/16x32 register files.
- Implement ROM and single-port RAM models.
- Implement synchronous-read RAM.
- Add address and write-enable decode.
- Implement config/status RO, WO and RW registers.
- Implement W1C and sticky-status behavior.
- Implement HW-set/SW-clear behavior.
- Integrate the register bank.
- Compare synchronous and asynchronous read behavior.
- Explain address decoding and address aliasing.
- Define RO, WO and RW register behavior.
- Explain W1C semantics.
- Explain sticky status and HW-set/SW-clear priority.
Repair address-aliasing and W1C defects, then demonstrate corrected read/write behavior.
- Register/memory RTL
- register map
- read/write testbench
- simulation log
- debug notes
- Read/write tests pass
- Access permissions behave correctly
- W1C/sticky behavior is demonstrated without address aliasing
Build, run and retain evidence
project_workspace/week3_verilog_rtl2/day13_registers/
RunWaveformReview before completing Day 13
- Concept
What does W1C mean for a status register?
Review answer
Write-one-to-clear: writing a 1 to a status bit clears that bit, while writing 0 leaves that bit unchanged.
- RTL reasoning
Why can partial address decoding cause two registers to appear at the same effective address?
Review answer
If not all required address bits are decoded, different addresses can satisfy the same select condition, creating address aliases.
- Debugging
A W1C implementation clears the entire status register whenever any 1 is written. What is wrong?
Review answer
The clear operation is too broad. Only status bits corresponding to written-one positions should be cleared, subject to the documented hardware-set/clear priority.
- Short answer
Why must simultaneous hardware-set and software-clear priority be documented?
Review answer
Both actions can target the same status bit in the same cycle. A defined priority makes the resulting state deterministic and verifiable.
Assessment: