BitFlow

True Dual-Port SRAM

intermediate · memory · 170 XP

Sign in to write your solution, run it in the simulator and submit it for grading.

Sign in or create a free account →

Problem

True Dual-Port SRAM A 256 × 8-bit RAM where **both ports are fully symmetric** — each can independently read or write on every clock edge. **Interface** (Port A and Port B, fully mirrored) | Port | Direction | Description | |--------------|-----------|-------------------------------| | `clk` | input | Shared clock | | `we_a` | input | Port A write enable | | `addr_a[7:0]`| input | Port A address | | `din_a[7:0]` | input | Port A write data | | `dout_a[7:0]`| output | Port A read data (registered) | | `we_b` | input | Port B write enable | | `addr_b[7:0]`| input | Port B address | | `din_b[7:0]` | input | Port B write data | | `dout_b[7:0]`| output | Port B read data (registered) | Both writes are **synchronous**. Both reads are **synchronous** (registered dout). **Write-write conflict rule:** If both ports write to the **same address** in the same cycle, **Port A wins**. Port B's data is silently discarded. Document this in comments. Each port uses **read-first** behaviour for its own simultaneous read/write.

Constraints

  • Both ports have synchronous registered reads (dout updated on posedge clk).
  • Simultaneous writes to same address: Port A wins.
  • Each port uses read-first for own same-address read/write.
  • This maps to Xilinx True Dual-Port BRAM or Intel M20K primitives.

Examples

Input: A writes addr=5, B reads addr=7 simultaneously

Output: Independent — no conflict

Different addresses

Input: A and B both write addr=5 in same cycle

Output: mem[5] = A's value, B's value lost

Port A wins conflict

Common questions

What does the True Dual-Port SRAM problem ask you to build?
True Dual-Port SRAM A 256 × 8-bit RAM where **both ports are fully symmetric** — each can independently read or write on every clock edge.
What constraints does True Dual-Port SRAM have?
Both ports have synchronous registered reads (dout updated on posedge clk).; Simultaneous writes to same address: Port A wins.; Each port uses read-first for own same-address read/write.; This maps to Xilinx True Dual-Port BRAM or Intel M20K primitives.
What is an example input and output for True Dual-Port SRAM?
Input A writes addr=5, B reads addr=7 simultaneously gives output Independent — no conflict. Different addresses
Which Verilog concepts does True Dual-Port SRAM practise?
memory, SRAM, dual-port, BRAM.