register files and memories ece 554 digital engineering laboratory c. r. kime and m.j. schulte and...
TRANSCRIPT
![Page 1: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/1.jpg)
Register Files and Memories
ECE 554Digital Engineering Laboratory
C. R. Kime and M.J. Schulte and M. LipastiModified: Kewal K. Saluja
10/2/2007
![Page 2: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/2.jpg)
ECE 554 - Digital Engineering Laboratory
2
Register Files and Memories• Register Files
– Issues and Objectives– Register File Concepts– Implementation of Register Files– Workarounds For Xilinx FPGAs– Bottom Line
• Memories– Timing Issues– Width Expansion
![Page 3: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/3.jpg)
ECE 554 - Digital Engineering Laboratory
3
Issues and Objectives
• Issues– ECE 554 projects require a broad range of register
file and memory configurations– ECE 554 lab boards provide very limited
structures for implementing register files and memories.
• Objectives:– To develop techniques for implementing a broad
range of register file and memory configurations by using available lab board structures
![Page 4: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/4.jpg)
ECE 554 - Digital Engineering Laboratory
4
Register File Concepts• Register file environments
– Non-Pipelined– Pipelined
• Register File Ports– Address Ports– Data Ports– Control Ports
• Register File Implementations
![Page 5: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/5.jpg)
ECE 554 - Digital Engineering Laboratory
5
Register File Ports• Address
– Read
– Write
– Shared
• Data– Input
– Output
– Bidirectional
• Control– Write Enable, Read/Write, Enable, Read, Write, CLK
![Page 6: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/6.jpg)
ECE 554 - Digital Engineering Laboratory
6
• Input Wdata C not registered outside of Register File– Clock controls when Wdata C is written
• Inputs WEN and Waddr C may or may not be registered
Environment - Non-Pipelined
RAddr A
RAddr B
Rdata A
Rdata B
Wdata CWAddr CWEn ALU
CLK
![Page 7: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/7.jpg)
ECE 554 - Digital Engineering Laboratory
7
• Register File is part of the pipeline platform• Inputs may or may not be registered
– Clock controls when Wdata C is written
Environment - Pipelined 1
RAddr A
RAddr B
Rdata A
Rdata B
Wdata CWAddr CWEn ALU
CLK......
...
CLK CLK
![Page 8: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/8.jpg)
ECE 554 - Digital Engineering Laboratory
8
• Register File– is between pipe stages– is not clocked - WEN controls latches => SRAM
• Inputs– may or may not be registered, but– register must be between Rdata A, Rdata B, and Wdata C
Environment - Pipelined 2
Raddr A
Raddr B
Rdata A
Rdata B
Wdata CWaddr CWEn ......
......
...
CLK CLK
![Page 9: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/9.jpg)
ECE 554 - Digital Engineering Laboratory
9
Latch-Based• Latch/bit of file• Latch control can be Write Enable and
addresses or some combination of other signals and addresses
...
......
...WEn
Waddr
Raddr
WdataRdata
...Write
Logic Read
Logic
![Page 10: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/10.jpg)
ECE 554 - Digital Engineering Laboratory
10
Latched-Based• Level-sensitive write (assume positive level)• Setup time on write address relative to leading edge
of Wen• Hold time on write address relative to trailing edge of
Wen• Setup and hold time on write data relative to trailing
edge of Wen• Latches cannot be in closed loop without:
– Additional latch on different clock in loop, or– Flip-flop in loop
![Page 11: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/11.jpg)
ECE 554 - Digital Engineering Laboratory
11
Flip-flop (Latch Pair)-Based• Flip-flop/bit of file• Flip-flop is clocked by CLK or some
combination of CLK and other signal and enabled by addressing logic and combination of other signals
...
......
...
WEn
Waddr
Raddr
WdataRdata
...Write
Logic Read
Logic
CLK
![Page 12: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/12.jpg)
ECE 554 - Digital Engineering Laboratory
12
Flip-flop (Latch Pair)-Based• Write Logic adds setup-time to that for flip-
flops• Read Logic adds propagation delay to that for
flip-flops• Acts as edge triggered flip-flop register file
with above delays added
![Page 13: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/13.jpg)
ECE 554 - Digital Engineering Laboratory
13
Flip-flop (Shared-Slave)-Based• Latch/bit of file plus latch/bit of output• Master latches are clocked by CLK or some
combination of CLK and other signal and enabled by addressing logic and combination of other signals; slave latches clocks by CLK
...
......
...
WEn
Waddr
Raddr
WdataRdata
...Write
Logic Read
Logic
CLKCLK
...
![Page 14: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/14.jpg)
ECE 554 - Digital Engineering Laboratory
14
Flip-flop (Shared-Master)-Based• Latch/bit of file plus latch/bit of input• Master latches are clocked by CLK some
combination of CLK and other signal and enabled by addressing logic and combination of other signals; slave latches clocks by CLK
...
......
...
WEn
Waddr
Raddr
WdataRdata
...
Write
Logic Read
Logic
CLKCLK
......
...
![Page 15: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/15.jpg)
ECE 554 - Digital Engineering Laboratory
15
Implementation of Register Files
• Custom VLSI SRAM• Classic SRAM• Xilinx Virtex SRAM
– Specifications– Shortcomings
![Page 16: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/16.jpg)
ECE 554 - Digital Engineering Laboratory
16
Custom VLSI SRAM• Is the most flexible of all implementation
techniques• Can be used to implement any combination
of variants discussed– Latch-based straightforward; needs additional
rank of latches to do flip-flop-based– Short of performance issues due to
capacitance, can implement any port configuration in a singe storage element array.
![Page 17: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/17.jpg)
ECE 554 - Digital Engineering Laboratory
17
Classic SRAM• Has single RWaddr port, single Wdata port, and single
Rdata port and is latch-based.– Due to single address port, can handle only one R or W access
per clock cycle
• Expansion to n R address/data ports– Place n SRAMs in parallel with the write accomplished by:
• Applying same address to all RWaddr, and
• Wiring together all Wdata ports
• Expansion to m W address/data ports– Add an m-way multiplexer to address port
– Use a clock that is m times CLK and multiplex the writes over m clocks
![Page 18: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/18.jpg)
ECE 554 - Digital Engineering Laboratory
18
Classic SRAM (Continued)• Addresses must be switched on positive clock edge• WEn must be generated from negative clock edge and positive clock
edge
• Expansion to m W address/data ports and n R address/data ports– Doing both expansions above
• Using (m +1)-way multiplexer, and• A clock that is (m + 1) times CLK
• Virtex Distributed SelectRAM– The SRAM capability provided in CLBs– Can be used with expansion methods here in classic asynchronous
SRAM mode or some synchronous modes– Getting reliable timing is tricky - may require more complex clocking!
![Page 19: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/19.jpg)
ECE 554 - Digital Engineering Laboratory
19
Virtex Block SRAM Specifications
• Symbol - Single Port
WEEN
DI[#:0]
RST
ADDR[#:0]CLK DO[#:0]
RAMB4_S#
![Page 20: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/20.jpg)
ECE 554 - Digital Engineering Laboratory
20
Virtex Block SRAM Specifications
• Symbol - Dual Port
WEAENA
DIA[#:0]
RSTA
ADDRA[#:0]CLKA DOA[#:0]
RAMB4_S#_S#
WEBENB
DIB[#:0]
RSTB
ADDRB[#:0]CLKB DOB[#:0]
![Page 21: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/21.jpg)
ECE 554 - Digital Engineering Laboratory
21
Virtex Block SRAM Specifications
• Functionality– A WRITE operation of data DI to address ADDR
occurs for WE = 1, EN = 1, RST = 0 and a positive edge on CLK. DI can also be read on DO after a delay.
– A READ operation from address ADDR occurs for WE = 0, EN = 1, RST = 0 and a positive edge on CLK.
– A RESET operation occurs on the DO latches only for EN = 1, RST = 1, and a positive edge on CLK
![Page 22: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/22.jpg)
ECE 554 - Digital Engineering Laboratory
22
Virtex Block SRAM Specifications
• Functionality– CLK, EN, WE, and RST can also be programmed
to be active low– Conflicts for Dual Port SRAM
• Simultaneous WRITEs to same location give invalid data• A simultaneous READ on the alternate port of a location
being written gives invalid READ data• A READ on the alternate port of a location being written
may not be performed until after a clock-to-clock setup window
![Page 23: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/23.jpg)
ECE 554 - Digital Engineering Laboratory
23
Virtex Block SRAM Specifications
• Functionality - Timing– EN, WE, RST, ADDR, DI are captured on the
positive edge of CLK in registers – WRITEs into the SRAM latch array occur later due
to internal timing logic– READs (including those associated with writes)
occur later due to internal timing logic
![Page 24: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/24.jpg)
ECE 554 - Digital Engineering Laboratory
24
Virtex Block SRAM Shortcomings• Positive edge-triggered storage of inputs to
SRAM places an implicit register in front of the SRAM– Combinational READs with address changing, for
example, on both the leading and trailing edge of clock, impossible (i.e. dual-porting with single clock)
– Feeding the SRAM array directly from combinational logic impossible
• Latching of outputs– Combinational READs impossible
![Page 25: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/25.jpg)
ECE 554 - Digital Engineering Laboratory
26
Workarounds for Virtex FPGAs
• Absorbing input registers• READ-after-alternate port-WRITE• READ port expansion• Inter-operation address
dependency removal• WRITE port expansion• Absorbing output latches
![Page 26: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/26.jpg)
ECE 554 - Digital Engineering Laboratory
27
Absorbing Input Registers• Non-Pipelined - looks like flip-flop-
based file - no absorbing needed!
ALU
WEAENA
DIA[#:0]
RSTA
ADDRA[#:0]CLKA DOA[#:0]
RAMB4_S#_S#
WEBENB
DIB[#:0]
RSTB
ADDRB[#:0]CLKB DOB[#:0]
CLK
CLK
![Page 27: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/27.jpg)
ECE 554 - Digital Engineering Laboratory
28
Absorbing Input Registers• Pipelined 1 - Register file part of pipeline
platform - looks like flip-flop-based file - no absorbing needed!
ALU .........
CLK CLK
WEAENA
DIA[#:0]
RSTA
ADDRA[#:0]CLKA DOA[#:0]
RAMB4_S#_S#
WEBENB
DIB[#:0]
RSTB
ADDRB[#:0]CLKB DOB[#:0]
CLK
CLK
PjPi
![Page 28: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/28.jpg)
ECE 554 - Digital Engineering Laboratory
29
...
Absorbing Input Registers• Pipelined 2 - Register file as SRAM between pipeline platforms - input
registers give unwanted platform - must absorb into Pi and Pj platforms
• Combinational logic between Pi and SRAM now placed before Pi
...
...
...
...
...
CLK
WEAENA
DIA[#:0]
RSTA
ADDRA[#:0]CLKA DOA[#:0]
RAMB4_S#_S#
WEBENB
DIB[#:0]
RSTB
ADDRB[#:0]CLKB DOB[#:0]
Pj
CLK
CLK
Pi
Pi
Pj
Pi
Pi
Pi
![Page 29: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/29.jpg)
ECE 554 - Digital Engineering Laboratory
30
Absorbing Input Registers• Summary• Non-pipelined - No problem• Pipelined 1 - No problem• Pipelined 2 - Problem
– Handle by moving pipeline platform pieces– Handle by converting to Pipeline 1 form– Affects combinational delay distribution between
stages and hence may affect pipeline performance
![Page 30: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/30.jpg)
ECE 554 - Digital Engineering Laboratory
31
• Additional implication of conditions on prior page:– Since the Virtex Block SRAM has two addresses, it should
support operands for a binary operation: R[ADDRA] <= R[ADDRA] op R[ADDRB] for arbitrary ADDRA and ADDRB on each clock cycle.– But, it does not!
• Since it is READ-after-WRITE, the right hand side operands are read in clock cycle i and the left hand side result is written in clock cycle i+1. One of the two addresses on the right hand side for cycle i must be the same as the write address on the left hand side for cycle i. Hazard logic would have to enforce this or insert a stall cycle (would almost always stall).
• Further, the READ-after-alternate port-WRITE problem causes the transfer R[ADDRy] <= R[ADDRx] op R[ADDRx] to be impossible to execute after a write to ADDRx. Would cause frequent stalls, once again.
Virtex Block SRAM Shortcomings
![Page 31: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/31.jpg)
ECE 554 - Digital Engineering Laboratory
32
Virtex Block SRAM Shortcomings• Using Dual Port Virtex Block SRAM with
custom VLSI SRAM used as the standard for comparison
• On a single clock cycle:– Maximum of two independent READ or WRITE
operations
– Maximum of two READbacks of written value from WRITE operation on same port possible
– READback of written value from WRITE on alternate port not possible
![Page 32: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/32.jpg)
ECE 554 - Digital Engineering Laboratory
33
READ-after-alternate port-WRITE• Add bypass logic outside of Virtex Block SRAM:
WEAENA
DIA[#:0]
RSTA
ADDRA[#:0]CLKA DOA[#:0]
RAMB4_S#_S#
WEBENB
DIB[#:0]
RSTB
ADDRB[#:0]CLKB DOB[#:0]
=
Select
Select CLK
CLK
CLK
CLK
P
P
1
0
0
1
![Page 33: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/33.jpg)
ECE 554 - Digital Engineering Laboratory
34
Read Port Expansion• Expansion to n R address/data ports
– Place ceiling(n/2) SRAMs in parallel with the two writes accomplished by:
• Applying same address to all ADDRA and the same address to all ADDRB, and
• Wiring together all DIA ports and all DIB ports
![Page 34: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/34.jpg)
ECE 554 - Digital Engineering Laboratory
35
Read Port Expansion• Example for n = 4
WEAENA
DIA[#:0]
RSTA
ADDRA[#:0]CLKA DOA[#:0]
RAMB4_S#_S#
WEBENB
DIB[#:0]
RSTB
ADDRB[#:0]CLKB DOB[#:0]
WEAENA
DIA[#:0]
RSTA
ADDRA[#:0]CLKA DOA[#:0]
RAMB4_S#_S#
WEBENB
DIB[#:0]
RSTB
ADDRB[#:0]CLKB DOB[#:0]
Select for all A mux’s
is WEA and all B mux’s
is WEB All other like-named signals
connected together
CLK
CLK
CLK
CLK
ENA
ENB
ENB2
ENB1
ENA2
ENA1WADDRA
RADDRA1
RADDRA2
RADDRB1
RADDRB2
WADDRB
DIADIB
![Page 35: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/35.jpg)
ECE 554 - Digital Engineering Laboratory
36
Inter-operation Address Dependency
• READ-after-WRITE - Can be done for one WRITE - two READs with two parallel Dual Port Block SRAMs with READ-after-alternate port-WRITE logic added to READ side of both. – Parallel WRITE on A ports
– Independent parallel READs on B-ports
• Each additional parallel Dual Port Block SRAM adds one more READ port
• Cannot accomplish WRITE-after-READ
• Cannot be done for more than one active WRITE port without using WRITE Port Expansion
![Page 36: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/36.jpg)
ECE 554 - Digital Engineering Laboratory
37
Write Port Expansion• Requires “super-clocking,” in which a clock
having a multiple of the frequency of the fundamental operational clock is used to serialize Block SRAM operations.
• Requires additional registers to locally enter into and return from serialized operations
• Muxes required that are switched by the a flip-flop driven by the faster clock
![Page 37: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/37.jpg)
ECE 554 - Digital Engineering Laboratory
38
Write Port Expansion• Example - Non-Pipelined - 4 WRITE Max
ports
WEAENA
DIA[#:0]
RSTA
ADDRA[#:0]CLKA DOA[#:0]
RAMB4_S#_S#
WEBENB
DIB[#:0]
RSTB
ADDRB[#:0]CLKB DOB[#:0]
2CLK
2CLK
PjPi -1
2CLK
2CLK
2CLK
2CLK
CLK CLK
Pi1
Pi2
![Page 38: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/38.jpg)
ECE 554 - Digital Engineering Laboratory
39
Absorbing Output Latches
• The output latch is a part of the attempt at a “flip-flop” appearance for the SRAM operation.
• As such, there appears to be no way to explicitly work around it
• Other workarounds handle its effects
![Page 39: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/39.jpg)
ECE 554 - Digital Engineering Laboratory
40
The Bottom Line• Overall, it appears that the best approach is to:
– Use a Non-Pipelined or Pipeline 1 structure– Use the Interoperation Dependency solution to achieve multiple dependency-
free READs– Use WRITE Port Expansion for multiple WRITEs– Use the READ-after-alternate port-WRITE to get READ-after-WRITE
capability– Use WRITE Port Expansion with READs on early subcycles to get WRITE-
after-READ capability– Be cognizant of substantial setup times and delays for the synchronous
operations
• Feel free to experiment with other approaches and apply ideas given to other Virtex Block SRAM uses
![Page 40: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/40.jpg)
ECE 554 - Digital Engineering Laboratory
41
Memories
• Timing Issues
• Width Expansion
![Page 41: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/41.jpg)
ECE 554 - Digital Engineering Laboratory
42
Timing Issues• The off-chip SRAMs are asynchronous and have typical
signal timing requirements• See AS7C4096 Datasheets for timing parameters
– Address controlled READ is easy– WE-controlled WRITE has zero setup and hold times which
look easy, but read on
• Due to unpredictable FPGA timing, timing of memory signals, particularly for WRITE should be verified.
• In worst case, may need to use “super clocking” to get reliable timing
![Page 42: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/42.jpg)
ECE 554 - Digital Engineering Laboratory
43
Width Expansion
• Width expansion can be achieved by using “super clocking” with implementation similar to that for register file write expansion.
• To expand a 16-bit word to a 16 n bit word requires “super clocking” at n times the fundamental rate.
![Page 43: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/43.jpg)
ECE 554 - Digital Engineering Laboratory
44
Width Expansion
• Implementation– For address-controlled READs, straight-
forward – Challenging for WRITEs:
• Must be trailing edges on, for example, WE, for each of the super clock cycles
• This will require changes on negative as well as positive super clock edges
![Page 44: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/44.jpg)
ECE 554 - Digital Engineering Laboratory
45
Postscript
• The workarounds do not consider:– Multiple clock edge use instead of super-clocking– Different clock edges on the two ports on a dual
port SelectRAM
• These techniques can potentially be beneficial to the degree that:– the resulting constructs are synthesizable, and– do not adversely affect performance
![Page 45: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/45.jpg)
ECE 554 - Digital Engineering Laboratory
46
Clocking Issues
• Limits of hardware and synthesis tools constrain clock and reset signal use
• Known problems and their workarounds– Generating reset signals – Limitations of the global clock routing– Using enable signals instead of clocks
![Page 46: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/46.jpg)
ECE 554 - Digital Engineering Laboratory
47
Reset Signals
• Generate reset signals only once, in top level module
• Pass signal down to lower level modules, but do not change it
• Both synchronous and asynchronous reset are OK, but be consistent.
![Page 47: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/47.jpg)
ECE 554 - Digital Engineering Laboratory
48
Reset Signals (cont.)
Logic
Top level module
Reset Internal module
Reset state
Reset state
Reset state
![Page 48: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/48.jpg)
ECE 554 - Digital Engineering Laboratory
49
Clocking Limitations
• Signals on the global clock routing cannot be used as inputs to combinational logic.
• Using a clock signal as a combinational input will pull that clock signal off the global routing, severely impacting performance.
![Page 49: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/49.jpg)
ECE 554 - Digital Engineering Laboratory
50
Clocking Examples
• BAD:– Signal_1 <= Signal_2 & clk;– Gated_clk <= Signal & clk;
• Neither clk or gated_clk will be on the global clock routing
• GOOD:– Use enable signals instead of clocks– Don’t use clock gating
![Page 50: Register Files and Memories ECE 554 Digital Engineering Laboratory C. R. Kime and M.J. Schulte and M. Lipasti Modified: Kewal K. Saluja 10/2/2007](https://reader036.vdocument.in/reader036/viewer/2022081519/56649e855503460f94b87835/html5/thumbnails/50.jpg)
ECE 554 - Digital Engineering Laboratory
51
Enable Vs. Clock
• Use enables instead of clocks:– Reg enable;
always @ (posedge clk or negedge clk)
begin
enable <= ~enable;
end
• Same waveform, but only uses clock as input to flip-flop – doesn’t pull it off global clock routing.