3系列FPGA中使用LUT构建分布式RAM(4)

前面讲了分布式RAM的方方面面,下面以RAM_16S为例,分别给出其在VHDL和Verilog HDL下面的模板代码(在ISE Project Navigator中选择 Edit--- Language Templates,然后选择VHDL 或者Verilog, 最后是Synthesis Templates --- RAM,在中也有具体调用过程的描述)。CORE Generator可以产生类似的代码以供行为仿真使用,它们可以在ISE Project Navigator中双击.coe文件看到。

VHDL Template Example
--
-- Module: RAM_16S
--
-- Descrip  TI on: VHDL instan  TI a  TI on template
-- Distributed RAM
-- Single Port 16 x 1
-- Can also be used for RAM16X1S_1
--
-- Device: Spartan-3 Family
--
---------------------------------------------------------------------
--
-- Components Declara  TI ons:
--
component RAM16X1S
-- pragma translate_off
generic (
-- RAM initialization (“0” by default) for functional simulation:
INIT : bit_vector := X"0000"
);
-- pragma translate_on
port (
D : in std_logic;
WE : in std_logic;
WCLK : in std_logic;
A0 : in std_logic;
A1 : in std_logic;
A2 : in std_logic;
A3 : in std_logic;
O : out std_logic
);
end component;
--
---------------------------------------------------------------------
--
-- Architecture section:
--
-- Attributes for RAM initialization ("0" by default):
attribute INIT: string;
--
attribute INIT of U_RAM16X1S: label is "0000";
--
-- Distributed RAM Instantiation
U_RAM16X1S: RAM16X1S
port map (
D => , -- insert Data input signal
WE => , -- insert Write Enable signal
WCLK => , -- insert Write Clock signal
A0 => , -- insert Address 0 signal
A1 => , -- insert Address 1 signal
A2 => , -- insert Address 2 signal
A3 => , -- insert Address 3 signal
O => -- insert Data output signal
);
--
---------------------------------------------------------------------
R
Verilog Template Example
//
// Module: RAM_16S
//
// Description: Verilog instantiation template
// Distributed RAM
// Single Port 16 x 1
// Can also be used for RAM16X1S_1
//
// Device: Spartan-3 Family
//
//-------------------------------------------------------------------
//
// Syntax for Synopsys FPGA Express
// synopsys translate_off
defparam
//RAM initialization (“0” by default) for functional simulation:
U_RAM16X1S.INIT = 16'h0000;
// synopsys translate_on
//Distributed RAM Instantiation
RAM16X1S U_RAM16X1S (
.D(), // insert input signal
.WE(), // insert Write Enable signal
.WCLK(), // insert Write Clock signal
.A0(), // insert Address 0 signal
.A1(), // insert Address 1 signal
.A2(), // insert Address 2 signal
.A3(), // insert Address 3 signal
.O() // insert output signal
);
// synthesis attribute declarations
/* synopsys attribute
INIT "0000"
*/

CORE Generator产生分布式RAM、同步FIFO和异步FIFO的说明文档可以分别在如下网址找到。
? CORE Generator: 分布式RAM模块

? CORE Generator: 同步FIFO模块

? CORE Generator: 异步FIFO模块

3系列FPGA中使用LUT构建分布式RAM(4)_设计制作_EMC/EMI设计
99
142
0
94

相关资讯

  1. 1、陈可辛谈《甜蜜蜜》往事:王菲剧本没看就推掉4781
  2. 2、速度与激情9预告终于来了!飙车上太空是真的,磁力吸车大招绝了4324
  3. 3、电影《爱拼北京》将映演绎爱“拼”一族789
  4. 4、《僵尸世界大战2》即将开拍,主演皮特回归,与丧尸斗争到底!2332
  5. 5、单身21年,58岁惠英红分享下一步计划:找个好人结婚4507
  6. 6、嫌弃吴磊?《长歌行》热巴吻戏用鸟替,粉丝却不知道错在哪881
  7. 7、白敬亭开新公司,出资百万成最大股东,却因名字太接地气引发爆笑2138
  8. 8、《装甲战争》二代钢铁侠现身,不是战争机器,是个黑人女孩?1631
  9. 9、《安德的游戏》今日公映“虫族”崛起对抗人类4919
  10. 10、《笑功震武林》首周票房3000万从头笑到尾2809
全部评论(0)
我也有话说
0
收藏
点赞
顶部