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
--
-- description: vhdl instantiation template
-- distributed ram
-- single port 16 x 1
-- can also be used for ram16x1s_1
--
-- device: spartan-3 family
--
---------------------------------------------------------------------
--
-- components declarations:
--
component ram16x1s
-- pragma translate_off
generic (
-- ram initialization (“0” by default) for functional simulation:
init : bit_vector := x0000
);
-- 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模块

螺杆支撑座
MLCC在5G终端上的演进
区块链给我们的生活带来了什么便利
华为云大数据,帮助企业搭好数据底座
中国移动发布手环首个三端翻盖的VR产品,打造零距离现场感
3系列FPGA中使用LUT构建分布式RAM(4)
好用的蓝牙耳机有哪些推荐?真无线运动蓝牙耳机
中南民族大学与大华股份签署战略合作协议
闪电网络可能会像比特币一样缺乏流动性而无法解决比特币的三重问题
30道Linux面试题总结
中芯国际调高去年Q4毛利率至30%,保持20%CAGR目标
C++:从技术实现角度聊聊RTTI
自给自足的电气化生态系统,将帮助我们更好地保护我们的星球
Allegro推出带有先进诊断功能和集成式电容器的全新可编程线性霍尔效应IC
中芯国际面临的四大挑战
人工智能正在掀起一场不可逆的数字化转型浪潮
iPhone用上USB-C后,我看苹果还有啥理由不给快充
终于要来了!锤子T3或9月份发布 配骁龙820处理器+4G RAM运存
360 N5手机评测?653处理器+6G运存+1399
为何UWB室内定位技术定位精度可以达到10cm?