Skip to content

Commit 420cb5a

Browse files
committed
rom_example2
1 parent 766a8e1 commit 420cb5a

File tree

3 files changed

+367
-0
lines changed

3 files changed

+367
-0
lines changed

lab_04/rom/rom_example2.vhd

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
-- megafunction wizard: %ROM: 1-PORT%
2+
-- GENERATION: STANDARD
3+
-- VERSION: WM1.0
4+
-- MODULE: altsyncram
5+
6+
-- ============================================================
7+
-- File Name: rom_example2.vhd
8+
-- Megafunction Name(s):
9+
-- altsyncram
10+
--
11+
-- Simulation Library Files(s):
12+
-- altera_mf
13+
-- ============================================================
14+
-- ************************************************************
15+
-- THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
16+
--
17+
-- 13.1.0 Build 162 10/23/2013 SJ Web Edition
18+
-- ************************************************************
19+
20+
21+
--Copyright (C) 1991-2013 Altera Corporation
22+
--Your use of Altera Corporation's design tools, logic functions
23+
--and other software and tools, and its AMPP partner logic
24+
--functions, and any output files from any of the foregoing
25+
--(including device programming or simulation files), and any
26+
--associated documentation or information are expressly subject
27+
--to the terms and conditions of the Altera Program License
28+
--Subscription Agreement, Altera MegaCore Function License
29+
--Agreement, or other applicable license agreement, including,
30+
--without limitation, that your use is for the sole purpose of
31+
--programming logic devices manufactured by Altera and sold by
32+
--Altera or its authorized distributors. Please refer to the
33+
--applicable agreement for further details.
34+
35+
36+
LIBRARY ieee;
37+
USE ieee.std_logic_1164.all;
38+
39+
LIBRARY altera_mf;
40+
USE altera_mf.altera_mf_components.all;
41+
42+
ENTITY rom_example2 IS
43+
PORT
44+
(
45+
address : IN STD_LOGIC_VECTOR (2 DOWNTO 0);
46+
clock : IN STD_LOGIC := '1';
47+
q : OUT STD_LOGIC_VECTOR (0 DOWNTO 0)
48+
);
49+
END rom_example2;
50+
51+
52+
ARCHITECTURE SYN OF rom_example2 IS
53+
54+
SIGNAL sub_wire0 : STD_LOGIC_VECTOR (0 DOWNTO 0);
55+
56+
BEGIN
57+
q <= sub_wire0(0 DOWNTO 0);
58+
59+
altsyncram_component : altsyncram
60+
GENERIC MAP (
61+
address_aclr_a => "NONE",
62+
clock_enable_input_a => "BYPASS",
63+
clock_enable_output_a => "BYPASS",
64+
init_file => "rom2.mif",
65+
intended_device_family => "Cyclone IV E",
66+
lpm_hint => "ENABLE_RUNTIME_MOD=NO",
67+
lpm_type => "altsyncram",
68+
numwords_a => 8,
69+
operation_mode => "ROM",
70+
outdata_aclr_a => "NONE",
71+
outdata_reg_a => "UNREGISTERED",
72+
widthad_a => 3,
73+
width_a => 1,
74+
width_byteena_a => 1
75+
)
76+
PORT MAP (
77+
address_a => address,
78+
clock0 => clock,
79+
q_a => sub_wire0
80+
);
81+
82+
83+
84+
END SYN;
85+
86+
-- ============================================================
87+
-- CNX file retrieval info
88+
-- ============================================================
89+
-- Retrieval info: PRIVATE: ADDRESSSTALL_A NUMERIC "0"
90+
-- Retrieval info: PRIVATE: AclrAddr NUMERIC "0"
91+
-- Retrieval info: PRIVATE: AclrByte NUMERIC "0"
92+
-- Retrieval info: PRIVATE: AclrOutput NUMERIC "0"
93+
-- Retrieval info: PRIVATE: BYTE_ENABLE NUMERIC "0"
94+
-- Retrieval info: PRIVATE: BYTE_SIZE NUMERIC "8"
95+
-- Retrieval info: PRIVATE: BlankMemory NUMERIC "0"
96+
-- Retrieval info: PRIVATE: CLOCK_ENABLE_INPUT_A NUMERIC "0"
97+
-- Retrieval info: PRIVATE: CLOCK_ENABLE_OUTPUT_A NUMERIC "0"
98+
-- Retrieval info: PRIVATE: Clken NUMERIC "0"
99+
-- Retrieval info: PRIVATE: IMPLEMENT_IN_LES NUMERIC "0"
100+
-- Retrieval info: PRIVATE: INIT_FILE_LAYOUT STRING "PORT_A"
101+
-- Retrieval info: PRIVATE: INIT_TO_SIM_X NUMERIC "0"
102+
-- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone IV E"
103+
-- Retrieval info: PRIVATE: JTAG_ENABLED NUMERIC "0"
104+
-- Retrieval info: PRIVATE: JTAG_ID STRING "NONE"
105+
-- Retrieval info: PRIVATE: MAXIMUM_DEPTH NUMERIC "0"
106+
-- Retrieval info: PRIVATE: MIFfilename STRING "rom2.mif"
107+
-- Retrieval info: PRIVATE: NUMWORDS_A NUMERIC "8"
108+
-- Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
109+
-- Retrieval info: PRIVATE: RegAddr NUMERIC "1"
110+
-- Retrieval info: PRIVATE: RegOutput NUMERIC "0"
111+
-- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "1"
112+
-- Retrieval info: PRIVATE: SingleClock NUMERIC "1"
113+
-- Retrieval info: PRIVATE: UseDQRAM NUMERIC "0"
114+
-- Retrieval info: PRIVATE: WidthAddr NUMERIC "3"
115+
-- Retrieval info: PRIVATE: WidthData NUMERIC "1"
116+
-- Retrieval info: PRIVATE: rden NUMERIC "0"
117+
-- Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
118+
-- Retrieval info: CONSTANT: ADDRESS_ACLR_A STRING "NONE"
119+
-- Retrieval info: CONSTANT: CLOCK_ENABLE_INPUT_A STRING "BYPASS"
120+
-- Retrieval info: CONSTANT: CLOCK_ENABLE_OUTPUT_A STRING "BYPASS"
121+
-- Retrieval info: CONSTANT: INIT_FILE STRING "rom2.mif"
122+
-- Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone IV E"
123+
-- Retrieval info: CONSTANT: LPM_HINT STRING "ENABLE_RUNTIME_MOD=NO"
124+
-- Retrieval info: CONSTANT: LPM_TYPE STRING "altsyncram"
125+
-- Retrieval info: CONSTANT: NUMWORDS_A NUMERIC "8"
126+
-- Retrieval info: CONSTANT: OPERATION_MODE STRING "ROM"
127+
-- Retrieval info: CONSTANT: OUTDATA_ACLR_A STRING "NONE"
128+
-- Retrieval info: CONSTANT: OUTDATA_REG_A STRING "UNREGISTERED"
129+
-- Retrieval info: CONSTANT: WIDTHAD_A NUMERIC "3"
130+
-- Retrieval info: CONSTANT: WIDTH_A NUMERIC "1"
131+
-- Retrieval info: CONSTANT: WIDTH_BYTEENA_A NUMERIC "1"
132+
-- Retrieval info: USED_PORT: address 0 0 3 0 INPUT NODEFVAL "address[2..0]"
133+
-- Retrieval info: USED_PORT: clock 0 0 0 0 INPUT VCC "clock"
134+
-- Retrieval info: USED_PORT: q 0 0 1 0 OUTPUT NODEFVAL "q[0..0]"
135+
-- Retrieval info: CONNECT: @address_a 0 0 3 0 address 0 0 3 0
136+
-- Retrieval info: CONNECT: @clock0 0 0 0 0 clock 0 0 0 0
137+
-- Retrieval info: CONNECT: q 0 0 1 0 @q_a 0 0 1 0
138+
-- Retrieval info: GEN_FILE: TYPE_NORMAL rom_example2.vhd TRUE
139+
-- Retrieval info: GEN_FILE: TYPE_NORMAL rom_example2.inc TRUE
140+
-- Retrieval info: GEN_FILE: TYPE_NORMAL rom_example2.cmp TRUE
141+
-- Retrieval info: GEN_FILE: TYPE_NORMAL rom_example2.bsf TRUE
142+
-- Retrieval info: GEN_FILE: TYPE_NORMAL rom_example2_inst.vhd TRUE
143+
-- Retrieval info: GEN_FILE: TYPE_NORMAL rom_example2_syn.v TRUE
144+
-- Retrieval info: LIB_FILE: altera_mf

lab_04/rom/rom_example2_inst.vhd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
rom_example2_inst : rom_example2 PORT MAP (
2+
address => address_sig,
3+
clock => clock_sig,
4+
q => q_sig
5+
);

lab_04/rom/rom_example2_syn.v

Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
// megafunction wizard: %ROM: 1-PORT%
2+
// GENERATION: STANDARD
3+
// VERSION: WM1.0
4+
// MODULE: altsyncram
5+
6+
// ============================================================
7+
// File Name: rom_example2.v
8+
// Megafunction Name(s):
9+
// altsyncram
10+
//
11+
// Simulation Library Files(s):
12+
// altera_mf
13+
// ============================================================
14+
// ************************************************************
15+
// THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
16+
//
17+
// 13.1.0 Build 162 10/23/2013 SJ Web Edition
18+
// ************************************************************
19+
20+
21+
//Copyright (C) 1991-2013 Altera Corporation
22+
//Your use of Altera Corporation's design tools, logic functions
23+
//and other software and tools, and its AMPP partner logic
24+
//functions, and any output files from any of the foregoing
25+
//(including device programming or simulation files), and any
26+
//associated documentation or information are expressly subject
27+
//to the terms and conditions of the Altera Program License
28+
//Subscription Agreement, Altera MegaCore Function License
29+
//Agreement, or other applicable license agreement, including,
30+
//without limitation, that your use is for the sole purpose of
31+
//programming logic devices manufactured by Altera and sold by
32+
//Altera or its authorized distributors. Please refer to the
33+
//applicable agreement for further details.
34+
35+
36+
//altsyncram ADDRESS_ACLR_A="NONE" CLOCK_ENABLE_INPUT_A="BYPASS" CLOCK_ENABLE_OUTPUT_A="BYPASS" DEVICE_FAMILY="Cyclone IV E" ENABLE_RUNTIME_MOD="NO" INIT_FILE="rom2.mif" NUMWORDS_A=8 OPERATION_MODE="ROM" OUTDATA_ACLR_A="NONE" OUTDATA_REG_A="UNREGISTERED" WIDTH_A=1 WIDTH_BYTEENA_A=1 WIDTHAD_A=3 address_a clock0 q_a
37+
//VERSION_BEGIN 13.1 cbx_altsyncram 2013:10:23:18:05:48:SJ cbx_cycloneii 2013:10:23:18:05:48:SJ cbx_lpm_add_sub 2013:10:23:18:05:48:SJ cbx_lpm_compare 2013:10:23:18:05:48:SJ cbx_lpm_decode 2013:10:23:18:05:48:SJ cbx_lpm_mux 2013:10:23:18:05:48:SJ cbx_mgl 2013:10:23:18:06:54:SJ cbx_stratix 2013:10:23:18:05:48:SJ cbx_stratixii 2013:10:23:18:05:48:SJ cbx_stratixiii 2013:10:23:18:05:48:SJ cbx_stratixv 2013:10:23:18:05:48:SJ cbx_util_mgl 2013:10:23:18:05:48:SJ VERSION_END
38+
// synthesis VERILOG_INPUT_VERSION VERILOG_2001
39+
// altera message_off 10463
40+
41+
42+
//synthesis_resources = M9K 1
43+
//synopsys translate_off
44+
`timescale 1 ps / 1 ps
45+
//synopsys translate_on
46+
(* ALTERA_ATTRIBUTE = {"OPTIMIZE_POWER_DURING_SYNTHESIS=NORMAL_COMPILATION"} *)
47+
module rom_example2_altsyncram
48+
(
49+
address_a,
50+
clock0,
51+
q_a) /* synthesis synthesis_clearbox=1 */;
52+
input [2:0] address_a;
53+
input clock0;
54+
output [0:0] q_a;
55+
`ifndef ALTERA_RESERVED_QIS
56+
// synopsys translate_off
57+
`endif
58+
tri1 clock0;
59+
`ifndef ALTERA_RESERVED_QIS
60+
// synopsys translate_on
61+
`endif
62+
63+
wire [0:0] wire_ram_block1a_0portadataout;
64+
wire [2:0] address_a_wire;
65+
66+
cycloneive_ram_block ram_block1a_0
67+
(
68+
.clk0(clock0),
69+
.portaaddr({address_a_wire[2:0]}),
70+
.portadataout(wire_ram_block1a_0portadataout[0:0]),
71+
.portare(1'b1),
72+
.portbdataout()
73+
`ifndef FORMAL_VERIFICATION
74+
// synopsys translate_off
75+
`endif
76+
,
77+
.clk1(1'b0),
78+
.clr0(1'b0),
79+
.clr1(1'b0),
80+
.ena0(1'b1),
81+
.ena1(1'b1),
82+
.ena2(1'b1),
83+
.ena3(1'b1),
84+
.portaaddrstall(1'b0),
85+
.portabyteenamasks({1{1'b1}}),
86+
.portadatain({1{1'b0}}),
87+
.portawe(1'b0),
88+
.portbaddr({1{1'b0}}),
89+
.portbaddrstall(1'b0),
90+
.portbbyteenamasks({1{1'b1}}),
91+
.portbdatain({1{1'b0}}),
92+
.portbre(1'b1),
93+
.portbwe(1'b0)
94+
`ifndef FORMAL_VERIFICATION
95+
// synopsys translate_on
96+
`endif
97+
// synopsys translate_off
98+
,
99+
.devclrn(1'b1),
100+
.devpor(1'b1)
101+
// synopsys translate_on
102+
);
103+
defparam
104+
ram_block1a_0.clk0_core_clock_enable = "none",
105+
ram_block1a_0.clk0_input_clock_enable = "none",
106+
ram_block1a_0.connectivity_checking = "OFF",
107+
ram_block1a_0.init_file = "rom2.mif",
108+
ram_block1a_0.init_file_layout = "port_a",
109+
ram_block1a_0.logical_ram_name = "ALTSYNCRAM",
110+
ram_block1a_0.mem_init0 = 8'h54,
111+
ram_block1a_0.operation_mode = "rom",
112+
ram_block1a_0.port_a_address_clear = "none",
113+
ram_block1a_0.port_a_address_width = 3,
114+
ram_block1a_0.port_a_data_out_clear = "none",
115+
ram_block1a_0.port_a_data_out_clock = "none",
116+
ram_block1a_0.port_a_data_width = 1,
117+
ram_block1a_0.port_a_first_address = 0,
118+
ram_block1a_0.port_a_first_bit_number = 0,
119+
ram_block1a_0.port_a_last_address = 7,
120+
ram_block1a_0.port_a_logical_ram_depth = 8,
121+
ram_block1a_0.port_a_logical_ram_width = 1,
122+
ram_block1a_0.ram_block_type = "AUTO",
123+
ram_block1a_0.lpm_type = "cycloneive_ram_block";
124+
assign
125+
address_a_wire = address_a,
126+
q_a = {wire_ram_block1a_0portadataout[0]};
127+
endmodule //rom_example2_altsyncram
128+
//VALID FILE
129+
130+
131+
// synopsys translate_off
132+
`timescale 1 ps / 1 ps
133+
// synopsys translate_on
134+
module rom_example2 (
135+
address,
136+
clock,
137+
q)/* synthesis synthesis_clearbox = 1 */;
138+
139+
input[2:0] address;
140+
input clock;
141+
output[0:0] q;
142+
`ifndef ALTERA_RESERVED_QIS
143+
// synopsys translate_off
144+
`endif
145+
tri1 clock;
146+
`ifndef ALTERA_RESERVED_QIS
147+
// synopsys translate_on
148+
`endif
149+
150+
wire [0:0] sub_wire0;
151+
wire [0:0] q = sub_wire0[0:0];
152+
153+
rom_example2_altsyncramrom_example2_altsyncram_component (
154+
.address_a (address),
155+
.clock0 (clock),
156+
.q_a (sub_wire0));
157+
158+
endmodule
159+
160+
// ============================================================
161+
// CNX file retrieval info
162+
// ============================================================
163+
// Retrieval info: PRIVATE: ADDRESSSTALL_A NUMERIC "0"
164+
// Retrieval info: PRIVATE: AclrAddr NUMERIC "0"
165+
// Retrieval info: PRIVATE: AclrByte NUMERIC "0"
166+
// Retrieval info: PRIVATE: AclrOutput NUMERIC "0"
167+
// Retrieval info: PRIVATE: BYTE_ENABLE NUMERIC "0"
168+
// Retrieval info: PRIVATE: BYTE_SIZE NUMERIC "8"
169+
// Retrieval info: PRIVATE: BlankMemory NUMERIC "0"
170+
// Retrieval info: PRIVATE: CLOCK_ENABLE_INPUT_A NUMERIC "0"
171+
// Retrieval info: PRIVATE: CLOCK_ENABLE_OUTPUT_A NUMERIC "0"
172+
// Retrieval info: PRIVATE: Clken NUMERIC "0"
173+
// Retrieval info: PRIVATE: IMPLEMENT_IN_LES NUMERIC "0"
174+
// Retrieval info: PRIVATE: INIT_FILE_LAYOUT STRING "PORT_A"
175+
// Retrieval info: PRIVATE: INIT_TO_SIM_X NUMERIC "0"
176+
// Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone IV E"
177+
// Retrieval info: PRIVATE: JTAG_ENABLED NUMERIC "0"
178+
// Retrieval info: PRIVATE: JTAG_ID STRING "NONE"
179+
// Retrieval info: PRIVATE: MAXIMUM_DEPTH NUMERIC "0"
180+
// Retrieval info: PRIVATE: MIFfilename STRING "rom2.mif"
181+
// Retrieval info: PRIVATE: NUMWORDS_A NUMERIC "8"
182+
// Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
183+
// Retrieval info: PRIVATE: RegAddr NUMERIC "1"
184+
// Retrieval info: PRIVATE: RegOutput NUMERIC "0"
185+
// Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "1"
186+
// Retrieval info: PRIVATE: SingleClock NUMERIC "1"
187+
// Retrieval info: PRIVATE: UseDQRAM NUMERIC "0"
188+
// Retrieval info: PRIVATE: WidthAddr NUMERIC "3"
189+
// Retrieval info: PRIVATE: WidthData NUMERIC "1"
190+
// Retrieval info: PRIVATE: rden NUMERIC "0"
191+
// Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
192+
// Retrieval info: CONSTANT: ADDRESS_ACLR_A STRING "NONE"
193+
// Retrieval info: CONSTANT: CLOCK_ENABLE_INPUT_A STRING "BYPASS"
194+
// Retrieval info: CONSTANT: CLOCK_ENABLE_OUTPUT_A STRING "BYPASS"
195+
// Retrieval info: CONSTANT: INIT_FILE STRING "rom2.mif"
196+
// Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone IV E"
197+
// Retrieval info: CONSTANT: LPM_HINT STRING "ENABLE_RUNTIME_MOD=NO"
198+
// Retrieval info: CONSTANT: LPM_TYPE STRING "altsyncram"
199+
// Retrieval info: CONSTANT: NUMWORDS_A NUMERIC "8"
200+
// Retrieval info: CONSTANT: OPERATION_MODE STRING "ROM"
201+
// Retrieval info: CONSTANT: OUTDATA_ACLR_A STRING "NONE"
202+
// Retrieval info: CONSTANT: OUTDATA_REG_A STRING "UNREGISTERED"
203+
// Retrieval info: CONSTANT: WIDTHAD_A NUMERIC "3"
204+
// Retrieval info: CONSTANT: WIDTH_A NUMERIC "1"
205+
// Retrieval info: CONSTANT: WIDTH_BYTEENA_A NUMERIC "1"
206+
// Retrieval info: USED_PORT: address 0 0 3 0 INPUT NODEFVAL "address[2..0]"
207+
// Retrieval info: USED_PORT: clock 0 0 0 0 INPUT VCC "clock"
208+
// Retrieval info: USED_PORT: q 0 0 1 0 OUTPUT NODEFVAL "q[0..0]"
209+
// Retrieval info: CONNECT: @address_a 0 0 3 0 address 0 0 3 0
210+
// Retrieval info: CONNECT: @clock0 0 0 0 0 clock 0 0 0 0
211+
// Retrieval info: CONNECT: q 0 0 1 0 @q_a 0 0 1 0
212+
// Retrieval info: GEN_FILE: TYPE_NORMAL rom_example2.vhd TRUE
213+
// Retrieval info: GEN_FILE: TYPE_NORMAL rom_example2.inc TRUE
214+
// Retrieval info: GEN_FILE: TYPE_NORMAL rom_example2.cmp TRUE
215+
// Retrieval info: GEN_FILE: TYPE_NORMAL rom_example2.bsf TRUE
216+
// Retrieval info: GEN_FILE: TYPE_NORMAL rom_example2_inst.vhd TRUE
217+
// Retrieval info: GEN_FILE: TYPE_NORMAL rom_example2_syn.v TRUE
218+
// Retrieval info: LIB_FILE: altera_mf

0 commit comments

Comments
 (0)