Skip to content

Commit 124a1d4

Browse files
Added extremely basic ALU and Microcode Unit with debugging features
1 parent fb95939 commit 124a1d4

File tree

12 files changed

+666
-30
lines changed

12 files changed

+666
-30
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
//lpm_ram_dq CBX_SINGLE_OUTPUT_FILE="ON" INTENDED_DEVICE_FAMILY=""Cyclone IV E"" LPM_ADDRESS_CONTROL="REGISTERED" LPM_INDATA="REGISTERED" LPM_OUTDATA="REGISTERED" LPM_WIDTH=8 LPM_WIDTHAD=8 USE_EAB="OFF" address data inclock outclock q we
2+
//VERSION_BEGIN 17.0 cbx_mgl 2017:04:25:18:09:28:SJ cbx_stratixii 2017:04:25:18:06:30:SJ cbx_util_mgl 2017:04:25:18:06:30:SJ VERSION_END
3+
// synthesis VERILOG_INPUT_VERSION VERILOG_2001
4+
// altera message_off 10463
5+
6+
7+
8+
// Copyright (C) 2017 Intel Corporation. All rights reserved.
9+
// Your use of Intel Corporation's design tools, logic functions
10+
// and other software and tools, and its AMPP partner logic
11+
// functions, and any output files from any of the foregoing
12+
// (including device programming or simulation files), and any
13+
// associated documentation or information are expressly subject
14+
// to the terms and conditions of the Intel Program License
15+
// Subscription Agreement, the Intel Quartus Prime License Agreement,
16+
// the Intel MegaCore Function License Agreement, or other
17+
// applicable license agreement, including, without limitation,
18+
// that your use is for the sole purpose of programming logic
19+
// devices manufactured by Intel and sold by Intel or its
20+
// authorized distributors. Please refer to the applicable
21+
// agreement for further details.
22+
23+
24+
25+
//synthesis_resources = lpm_ram_dq 1
26+
//synopsys translate_off
27+
`timescale 1 ps / 1 ps
28+
//synopsys translate_on
29+
module mg9pl
30+
(
31+
address,
32+
data,
33+
inclock,
34+
outclock,
35+
q,
36+
we) /* synthesis synthesis_clearbox=1 */;
37+
input [7:0] address;
38+
input [7:0] data;
39+
input inclock;
40+
input outclock;
41+
output [7:0] q;
42+
input we;
43+
44+
wire [7:0] wire_mgl_prim1_q;
45+
46+
lpm_ram_dq mgl_prim1
47+
(
48+
.address(address),
49+
.data(data),
50+
.inclock(inclock),
51+
.outclock(outclock),
52+
.q(wire_mgl_prim1_q),
53+
.we(we));
54+
defparam
55+
mgl_prim1.intended_device_family = ""Cyclone IV E"",
56+
mgl_prim1.lpm_address_control = "REGISTERED",
57+
mgl_prim1.lpm_indata = "REGISTERED",
58+
mgl_prim1.lpm_outdata = "REGISTERED",
59+
mgl_prim1.lpm_width = 8,
60+
mgl_prim1.lpm_widthad = 8,
61+
mgl_prim1.use_eab = "OFF";
62+
assign
63+
q = wire_mgl_prim1_q;
64+
endmodule //mg9pl
65+
//VALID FILE
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
set_global_assignment -name IP_TOOL_NAME "ROM: 1-PORT"
2+
set_global_assignment -name IP_TOOL_VERSION "17.0"
3+
set_global_assignment -name IP_GENERATED_DEVICE_FAMILY "{Cyclone IV E}"
4+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) "onchip_mem_microcode_segment.v"]
5+
set_global_assignment -name MISC_FILE [file join $::quartus(qip_path) "onchip_mem_microcode_segment_inst.v"]
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
// megafunction wizard: %ROM: 1-PORT%
2+
// GENERATION: STANDARD
3+
// VERSION: WM1.0
4+
// MODULE: altsyncram
5+
6+
// ============================================================
7+
// File Name: onchip_mem_microcode_segment.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+
// 17.0.0 Build 595 04/25/2017 SJ Lite Edition
18+
// ************************************************************
19+
20+
21+
//Copyright (C) 2017 Intel Corporation. All rights reserved.
22+
//Your use of Intel 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 Intel Program License
28+
//Subscription Agreement, the Intel Quartus Prime License Agreement,
29+
//the Intel MegaCore Function License Agreement, or other
30+
//applicable license agreement, including, without limitation,
31+
//that your use is for the sole purpose of programming logic
32+
//devices manufactured by Intel and sold by Intel or its
33+
//authorized distributors. Please refer to the applicable
34+
//agreement for further details.
35+
36+
37+
// synopsys translate_off
38+
`timescale 1 ps / 1 ps
39+
// synopsys translate_on
40+
module onchip_mem_microcode_segment (
41+
address,
42+
clock,
43+
q);
44+
45+
input [7:0] address;
46+
input clock;
47+
output [7:0] q;
48+
`ifndef ALTERA_RESERVED_QIS
49+
// synopsys translate_off
50+
`endif
51+
tri1 clock;
52+
`ifndef ALTERA_RESERVED_QIS
53+
// synopsys translate_on
54+
`endif
55+
56+
wire [7:0] sub_wire0;
57+
wire [7:0] q = sub_wire0[7:0];
58+
59+
altsyncram altsyncram_component (
60+
.address_a (address),
61+
.clock0 (clock),
62+
.q_a (sub_wire0),
63+
.aclr0 (1'b0),
64+
.aclr1 (1'b0),
65+
.address_b (1'b1),
66+
.addressstall_a (1'b0),
67+
.addressstall_b (1'b0),
68+
.byteena_a (1'b1),
69+
.byteena_b (1'b1),
70+
.clock1 (1'b1),
71+
.clocken0 (1'b1),
72+
.clocken1 (1'b1),
73+
.clocken2 (1'b1),
74+
.clocken3 (1'b1),
75+
.data_a ({8{1'b1}}),
76+
.data_b (1'b1),
77+
.eccstatus (),
78+
.q_b (),
79+
.rden_a (1'b1),
80+
.rden_b (1'b1),
81+
.wren_a (1'b0),
82+
.wren_b (1'b0));
83+
defparam
84+
altsyncram_component.address_aclr_a = "NONE",
85+
altsyncram_component.clock_enable_input_a = "BYPASS",
86+
altsyncram_component.clock_enable_output_a = "BYPASS",
87+
`ifdef NO_PLI
88+
altsyncram_component.init_file = "../../bin/onchip_mem_microcode_segment.rif"
89+
`else
90+
altsyncram_component.init_file = "../../bin/onchip_mem_microcode_segment.hex"
91+
`endif
92+
,
93+
altsyncram_component.intended_device_family = "Cyclone IV E",
94+
altsyncram_component.lpm_hint = "ENABLE_RUNTIME_MOD=YES,INSTANCE_NAME=ROM2",
95+
altsyncram_component.lpm_type = "altsyncram",
96+
altsyncram_component.numwords_a = 256,
97+
altsyncram_component.operation_mode = "ROM",
98+
altsyncram_component.outdata_aclr_a = "NONE",
99+
altsyncram_component.outdata_reg_a = "UNREGISTERED",
100+
altsyncram_component.widthad_a = 8,
101+
altsyncram_component.width_a = 8,
102+
altsyncram_component.width_byteena_a = 1;
103+
104+
105+
endmodule
106+
107+
// ============================================================
108+
// CNX file retrieval info
109+
// ============================================================
110+
// Retrieval info: PRIVATE: ADDRESSSTALL_A NUMERIC "0"
111+
// Retrieval info: PRIVATE: AclrAddr NUMERIC "0"
112+
// Retrieval info: PRIVATE: AclrByte NUMERIC "0"
113+
// Retrieval info: PRIVATE: AclrOutput NUMERIC "0"
114+
// Retrieval info: PRIVATE: BYTE_ENABLE NUMERIC "0"
115+
// Retrieval info: PRIVATE: BYTE_SIZE NUMERIC "8"
116+
// Retrieval info: PRIVATE: BlankMemory NUMERIC "0"
117+
// Retrieval info: PRIVATE: CLOCK_ENABLE_INPUT_A NUMERIC "0"
118+
// Retrieval info: PRIVATE: CLOCK_ENABLE_OUTPUT_A NUMERIC "0"
119+
// Retrieval info: PRIVATE: Clken NUMERIC "0"
120+
// Retrieval info: PRIVATE: IMPLEMENT_IN_LES NUMERIC "0"
121+
// Retrieval info: PRIVATE: INIT_FILE_LAYOUT STRING "PORT_A"
122+
// Retrieval info: PRIVATE: INIT_TO_SIM_X NUMERIC "0"
123+
// Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone IV E"
124+
// Retrieval info: PRIVATE: JTAG_ENABLED NUMERIC "1"
125+
// Retrieval info: PRIVATE: JTAG_ID STRING "ROM2"
126+
// Retrieval info: PRIVATE: MAXIMUM_DEPTH NUMERIC "0"
127+
// Retrieval info: PRIVATE: MIFfilename STRING "../../bin/onchip_mem_microcode_segment.hex"
128+
// Retrieval info: PRIVATE: NUMWORDS_A NUMERIC "256"
129+
// Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
130+
// Retrieval info: PRIVATE: RegAddr NUMERIC "1"
131+
// Retrieval info: PRIVATE: RegOutput NUMERIC "0"
132+
// Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
133+
// Retrieval info: PRIVATE: SingleClock NUMERIC "1"
134+
// Retrieval info: PRIVATE: UseDQRAM NUMERIC "0"
135+
// Retrieval info: PRIVATE: WidthAddr NUMERIC "8"
136+
// Retrieval info: PRIVATE: WidthData NUMERIC "8"
137+
// Retrieval info: PRIVATE: rden NUMERIC "0"
138+
// Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
139+
// Retrieval info: CONSTANT: ADDRESS_ACLR_A STRING "NONE"
140+
// Retrieval info: CONSTANT: CLOCK_ENABLE_INPUT_A STRING "BYPASS"
141+
// Retrieval info: CONSTANT: CLOCK_ENABLE_OUTPUT_A STRING "BYPASS"
142+
// Retrieval info: CONSTANT: INIT_FILE STRING "../../bin/onchip_mem_microcode_segment.hex"
143+
// Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone IV E"
144+
// Retrieval info: CONSTANT: LPM_HINT STRING "ENABLE_RUNTIME_MOD=YES,INSTANCE_NAME=ROM2"
145+
// Retrieval info: CONSTANT: LPM_TYPE STRING "altsyncram"
146+
// Retrieval info: CONSTANT: NUMWORDS_A NUMERIC "256"
147+
// Retrieval info: CONSTANT: OPERATION_MODE STRING "ROM"
148+
// Retrieval info: CONSTANT: OUTDATA_ACLR_A STRING "NONE"
149+
// Retrieval info: CONSTANT: OUTDATA_REG_A STRING "UNREGISTERED"
150+
// Retrieval info: CONSTANT: WIDTHAD_A NUMERIC "8"
151+
// Retrieval info: CONSTANT: WIDTH_A NUMERIC "8"
152+
// Retrieval info: CONSTANT: WIDTH_BYTEENA_A NUMERIC "1"
153+
// Retrieval info: USED_PORT: address 0 0 8 0 INPUT NODEFVAL "address[7..0]"
154+
// Retrieval info: USED_PORT: clock 0 0 0 0 INPUT VCC "clock"
155+
// Retrieval info: USED_PORT: q 0 0 8 0 OUTPUT NODEFVAL "q[7..0]"
156+
// Retrieval info: CONNECT: @address_a 0 0 8 0 address 0 0 8 0
157+
// Retrieval info: CONNECT: @clock0 0 0 0 0 clock 0 0 0 0
158+
// Retrieval info: CONNECT: q 0 0 8 0 @q_a 0 0 8 0
159+
// Retrieval info: GEN_FILE: TYPE_NORMAL onchip_mem_microcode_segment.v TRUE
160+
// Retrieval info: GEN_FILE: TYPE_NORMAL onchip_mem_microcode_segment.inc FALSE
161+
// Retrieval info: GEN_FILE: TYPE_NORMAL onchip_mem_microcode_segment.cmp FALSE
162+
// Retrieval info: GEN_FILE: TYPE_NORMAL onchip_mem_microcode_segment.bsf FALSE
163+
// Retrieval info: GEN_FILE: TYPE_NORMAL onchip_mem_microcode_segment_inst.v TRUE
164+
// Retrieval info: GEN_FILE: TYPE_NORMAL onchip_mem_microcode_segment_bb.v FALSE
165+
// Retrieval info: LIB_FILE: altera_mf
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
set_global_assignment -name IP_TOOL_NAME "ROM: 1-PORT"
2+
set_global_assignment -name IP_TOOL_VERSION "17.0"
3+
set_global_assignment -name IP_GENERATED_DEVICE_FAMILY "{Cyclone IV E}"
4+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) "onchip_rom_microcode.v"]
5+
set_global_assignment -name MISC_FILE [file join $::quartus(qip_path) "onchip_rom_microcode_inst.v"]
6+
set_global_assignment -name MISC_FILE [file join $::quartus(qip_path) "onchip_rom_microcode_bb.v"]

0 commit comments

Comments
 (0)