RAM
Model of the Month
We can update you automatically when this page changes.
To receive regular notification of updates to our Model of the Month section, click here.
Simple RAM Model
This month, a simple RAM model, written in Verilog. Following on from last month’s
introduction to parameterisation, the RAM model presented here is parameterisable in terms of memory depth and wordlength. Memory depth is parameterised using the AddressSize parameter, whilst WordSize is used to parameterise the wordlength.The declaration,
reg [WordSize-1:0] Mem [0:1< Just like the shift register model from November, the parameterisable bidirectional port is modelled as a conditional assignment. This assignment effectively models the read process from the RAM. The first always block models the write process. The second provides a simple simultaneous read-write check. Note that it is not possible address individual bits in the memory block using two-dimensional addressing as in VHDL. In Verilog, you need to create a temporary reg object for the memory word and then access a bit or a bit-select from that temporary reg object.Oh, yes. How about a timing diagram? http://www.doulos.co.uk/models/model_9612.htm99-12-10 Doulos ASIC Design and FPGA Design : Model of the Month, December 1996Page 2 of 2 You are welcome to use the source code we provide but you must keep the copyright notice with the code (see the Acknowledgements page for more details). // RAM Model// // +-----------------------------+// | Copyright 1996 DOULOS |// | Library: Memory |// | designer : John Aynsley |// +-----------------------------+ module RamChip (Address, Data, CS, WE, OE);parameter AddressSize = 1;parameter WordSize = 1; input [AddressSize-1:0] Address;inout [WordSize-1:0] Data;input CS, WE, OE; reg [WordSize-1:0] Mem [0:1< Mem[Address] = Data; always @(WE or OE) if (!WE && !OE) $display(\"Operational error in RamChip: OE and WE both active\");endmodule VHDL and Verilog source code for other Models of the Monthcan be downloaded from here. FPGA / ASIC Design and Project ServicesDoulos Training CoursesDoulos Home PageCopyright 1995-1996 Doulos This page was last updated 29th November 1996. We welcome your e-mail comments. Please contact us at: webmaster@doulos.co.ukhttp://www.doulos.co.uk/models/model_9612.htm99-12-10 因篇幅问题不能全部显示,请点此查看更多更全内容