Skip to content

Commit 8c9ddb2

Browse files
initial commit
0 parents  commit 8c9ddb2

35 files changed

+8762
-0
lines changed

Diff for: .gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
db/
2+
greybox_tmp/
3+
incremental_db/
4+
output_files/
5+
simulation/
6+
*.bak

Diff for: ALU.v

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module ALU (
2+
input [11:0]a,b, // a - from Accumulator, b - from data-bus
3+
input [2:0]selectOp,
4+
output [11:0]dataOut
5+
);
6+
7+
localparam clr = 3'd0, // ALU operations and their control signals
8+
pass = 3'd1,
9+
add = 3'd2,
10+
sub = 3'd3,
11+
mul = 3'd4,
12+
inc = 3'd5,
13+
idle = 3'dx;
14+
15+
//output of the ALU is decided as below
16+
assign dataOut = (selectOp == clr)? 12'd0:
17+
(selectOp == pass)? b:
18+
(selectOp == add)? a+b:
19+
(selectOp == sub)? a-b:
20+
(selectOp == mul)? a*b:
21+
(selectOp == inc)? a+12'd1:
22+
11'dx; // default value is undefined
23+
24+
endmodule //ALU

Diff for: BCDtoHEX.v

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// module BCDtoHEX(
2+
// input [3:0]in0,in1,in2,in3,in4,in5,in6,in7,
3+
// input start,rst,clk,
4+
// output [6:0]out0,out1,out2,out3,out4,out5,out6,out7
5+
// );
6+
// localparam
7+
// idle = 1'b0,
8+
// process = 1'b1;
9+
10+
// reg currentState, nextState;
11+
// reg [31:0]currentSsIn,nextSsIn;
12+
13+
// always @(posedge clk , negedge rst) begin
14+
// if (!rst) begin
15+
// currentState <= idle;
16+
// currentSsIn <= 32'b0;
17+
// end
18+
// else begin
19+
// currentState <= nextState;
20+
// currentSsIn <= nextSsIn;
21+
// end
22+
// end
23+
24+
// always @(*) begin
25+
// nextState = currentState;
26+
// nextSsIn = currentSsIn;
27+
// case (currentState )
28+
// idle: begin
29+
// nextSsIn = {32{1'b1}}; // show nothing
30+
// if (!start) // start is push button work at negedge
31+
// nextState = process;
32+
// end
33+
// process:
34+
// nextSsIn = {in7,in6,in5,in4,in3,in2,in1,in0};
35+
// endcase
36+
// end
37+
38+
39+
40+
// SSeg s0(.in(currentSsIn[3:0]),.out(out0));
41+
// SSeg s1(.in(currentSsIn[7:4]),.out(out1));
42+
// SSeg s2(.in(currentSsIn[11:8]),.out(out2));
43+
// SSeg s3(.in(currentSsIn[15:12]),.out(out3));
44+
// SSeg s4(.in(currentSsIn[19:16]),.out(out4));
45+
// SSeg s5(.in(currentSsIn[23:20]),.out(out5));
46+
// SSeg s6(.in(currentSsIn[27:24]),.out(out6));
47+
// SSeg s7(.in(currentSsIn[31:28]),.out(out7));
48+
49+
50+
// endmodule // BCDtoHEX
51+
52+
module BCDtoHEX(
53+
input [4:0]in0,in1,in2,in3,in4,in5,in6,in7,
54+
output [6:0]out0,out1,out2,out3,out4,out5,out6,out7
55+
);
56+
57+
SSeg s0(.in(in0),.out(out0));
58+
SSeg s1(.in(in1),.out(out1));
59+
SSeg s2(.in(in2),.out(out2));
60+
SSeg s3(.in(in3),.out(out3));
61+
SSeg s4(.in(in4),.out(out4));
62+
SSeg s5(.in(in5),.out(out5));
63+
SSeg s6(.in(in6),.out(out6));
64+
SSeg s7(.in(in7),.out(out7));
65+
66+
67+
endmodule // BCDtoHEX

Diff for: IP_dataMem.qip

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
set_global_assignment -name IP_TOOL_NAME "RAM: 1-PORT"
2+
set_global_assignment -name IP_TOOL_VERSION "18.1"
3+
set_global_assignment -name IP_GENERATED_DEVICE_FAMILY "{Cyclone IV E}"
4+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) "IP_dataMem.v"]
5+
set_global_assignment -name MISC_FILE [file join $::quartus(qip_path) "IP_dataMem_bb.v"]
6+
set_global_assignment -name MISC_FILE [file join $::quartus(qip_path) "IP_dataMem_syn.v"]

Diff for: IP_dataMem.v

+175
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
// megafunction wizard: %RAM: 1-PORT%
2+
// GENERATION: STANDARD
3+
// VERSION: WM1.0
4+
// MODULE: altsyncram
5+
6+
// ============================================================
7+
// File Name: IP_dataMem.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+
// 18.1.0 Build 625 09/12/2018 SJ Lite Edition
18+
// ************************************************************
19+
20+
21+
//Copyright (C) 2018 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 FPGA IP License Agreement, or other applicable license
30+
//agreement, including, without limitation, that your use is for
31+
//the sole purpose of programming logic devices manufactured by
32+
//Intel and sold by Intel or its authorized distributors. Please
33+
//refer to the applicable agreement for further details.
34+
35+
36+
// synopsys translate_off
37+
`timescale 1 ps / 1 ps
38+
// synopsys translate_on
39+
module IP_dataMem (
40+
address,
41+
clock,
42+
data,
43+
wren,
44+
q);
45+
46+
input [11:0] address;
47+
input clock;
48+
input [47:0] data;
49+
input wren;
50+
output [47:0] q;
51+
`ifndef ALTERA_RESERVED_QIS
52+
// synopsys translate_off
53+
`endif
54+
tri1 clock;
55+
`ifndef ALTERA_RESERVED_QIS
56+
// synopsys translate_on
57+
`endif
58+
59+
wire [47:0] sub_wire0;
60+
wire [47:0] q = sub_wire0[47:0];
61+
62+
altsyncram altsyncram_component (
63+
.address_a (address),
64+
.clock0 (clock),
65+
.data_a (data),
66+
.wren_a (wren),
67+
.q_a (sub_wire0),
68+
.aclr0 (1'b0),
69+
.aclr1 (1'b0),
70+
.address_b (1'b1),
71+
.addressstall_a (1'b0),
72+
.addressstall_b (1'b0),
73+
.byteena_a (1'b1),
74+
.byteena_b (1'b1),
75+
.clock1 (1'b1),
76+
.clocken0 (1'b1),
77+
.clocken1 (1'b1),
78+
.clocken2 (1'b1),
79+
.clocken3 (1'b1),
80+
.data_b (1'b1),
81+
.eccstatus (),
82+
.q_b (),
83+
.rden_a (1'b1),
84+
.rden_b (1'b1),
85+
.wren_b (1'b0));
86+
defparam
87+
altsyncram_component.clock_enable_input_a = "BYPASS",
88+
altsyncram_component.clock_enable_output_a = "BYPASS",
89+
altsyncram_component.intended_device_family = "Cyclone IV E",
90+
altsyncram_component.lpm_hint = "ENABLE_RUNTIME_MOD=YES,INSTANCE_NAME=DATA",
91+
altsyncram_component.lpm_type = "altsyncram",
92+
altsyncram_component.numwords_a = 4096,
93+
altsyncram_component.operation_mode = "SINGLE_PORT",
94+
altsyncram_component.outdata_aclr_a = "NONE",
95+
altsyncram_component.outdata_reg_a = "UNREGISTERED",
96+
altsyncram_component.power_up_uninitialized = "FALSE",
97+
altsyncram_component.ram_block_type = "M9K",
98+
altsyncram_component.read_during_write_mode_port_a = "NEW_DATA_NO_NBE_READ",
99+
altsyncram_component.widthad_a = 12,
100+
altsyncram_component.width_a = 48,
101+
altsyncram_component.width_byteena_a = 1;
102+
103+
104+
endmodule
105+
106+
// ============================================================
107+
// CNX file retrieval info
108+
// ============================================================
109+
// Retrieval info: PRIVATE: ADDRESSSTALL_A NUMERIC "0"
110+
// Retrieval info: PRIVATE: AclrAddr NUMERIC "0"
111+
// Retrieval info: PRIVATE: AclrByte NUMERIC "0"
112+
// Retrieval info: PRIVATE: AclrData 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 "1"
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: DataBusSeparated NUMERIC "1"
121+
// Retrieval info: PRIVATE: IMPLEMENT_IN_LES NUMERIC "0"
122+
// Retrieval info: PRIVATE: INIT_FILE_LAYOUT STRING "PORT_A"
123+
// Retrieval info: PRIVATE: INIT_TO_SIM_X NUMERIC "0"
124+
// Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone IV E"
125+
// Retrieval info: PRIVATE: JTAG_ENABLED NUMERIC "1"
126+
// Retrieval info: PRIVATE: JTAG_ID STRING "DATA"
127+
// Retrieval info: PRIVATE: MAXIMUM_DEPTH NUMERIC "0"
128+
// Retrieval info: PRIVATE: MIFfilename STRING ""
129+
// Retrieval info: PRIVATE: NUMWORDS_A NUMERIC "4096"
130+
// Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "2"
131+
// Retrieval info: PRIVATE: READ_DURING_WRITE_MODE_PORT_A NUMERIC "3"
132+
// Retrieval info: PRIVATE: RegAddr NUMERIC "1"
133+
// Retrieval info: PRIVATE: RegData NUMERIC "1"
134+
// Retrieval info: PRIVATE: RegOutput NUMERIC "0"
135+
// Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "1"
136+
// Retrieval info: PRIVATE: SingleClock NUMERIC "1"
137+
// Retrieval info: PRIVATE: UseDQRAM NUMERIC "1"
138+
// Retrieval info: PRIVATE: WRCONTROL_ACLR_A NUMERIC "0"
139+
// Retrieval info: PRIVATE: WidthAddr NUMERIC "12"
140+
// Retrieval info: PRIVATE: WidthData NUMERIC "48"
141+
// Retrieval info: PRIVATE: rden NUMERIC "0"
142+
// Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
143+
// Retrieval info: CONSTANT: CLOCK_ENABLE_INPUT_A STRING "BYPASS"
144+
// Retrieval info: CONSTANT: CLOCK_ENABLE_OUTPUT_A STRING "BYPASS"
145+
// Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone IV E"
146+
// Retrieval info: CONSTANT: LPM_HINT STRING "ENABLE_RUNTIME_MOD=YES,INSTANCE_NAME=DATA"
147+
// Retrieval info: CONSTANT: LPM_TYPE STRING "altsyncram"
148+
// Retrieval info: CONSTANT: NUMWORDS_A NUMERIC "4096"
149+
// Retrieval info: CONSTANT: OPERATION_MODE STRING "SINGLE_PORT"
150+
// Retrieval info: CONSTANT: OUTDATA_ACLR_A STRING "NONE"
151+
// Retrieval info: CONSTANT: OUTDATA_REG_A STRING "UNREGISTERED"
152+
// Retrieval info: CONSTANT: POWER_UP_UNINITIALIZED STRING "FALSE"
153+
// Retrieval info: CONSTANT: RAM_BLOCK_TYPE STRING "M9K"
154+
// Retrieval info: CONSTANT: READ_DURING_WRITE_MODE_PORT_A STRING "NEW_DATA_NO_NBE_READ"
155+
// Retrieval info: CONSTANT: WIDTHAD_A NUMERIC "12"
156+
// Retrieval info: CONSTANT: WIDTH_A NUMERIC "48"
157+
// Retrieval info: CONSTANT: WIDTH_BYTEENA_A NUMERIC "1"
158+
// Retrieval info: USED_PORT: address 0 0 12 0 INPUT NODEFVAL "address[11..0]"
159+
// Retrieval info: USED_PORT: clock 0 0 0 0 INPUT VCC "clock"
160+
// Retrieval info: USED_PORT: data 0 0 48 0 INPUT NODEFVAL "data[47..0]"
161+
// Retrieval info: USED_PORT: q 0 0 48 0 OUTPUT NODEFVAL "q[47..0]"
162+
// Retrieval info: USED_PORT: wren 0 0 0 0 INPUT NODEFVAL "wren"
163+
// Retrieval info: CONNECT: @address_a 0 0 12 0 address 0 0 12 0
164+
// Retrieval info: CONNECT: @clock0 0 0 0 0 clock 0 0 0 0
165+
// Retrieval info: CONNECT: @data_a 0 0 48 0 data 0 0 48 0
166+
// Retrieval info: CONNECT: @wren_a 0 0 0 0 wren 0 0 0 0
167+
// Retrieval info: CONNECT: q 0 0 48 0 @q_a 0 0 48 0
168+
// Retrieval info: GEN_FILE: TYPE_NORMAL IP_dataMem.v TRUE
169+
// Retrieval info: GEN_FILE: TYPE_NORMAL IP_dataMem.inc FALSE
170+
// Retrieval info: GEN_FILE: TYPE_NORMAL IP_dataMem.cmp FALSE
171+
// Retrieval info: GEN_FILE: TYPE_NORMAL IP_dataMem.bsf FALSE
172+
// Retrieval info: GEN_FILE: TYPE_NORMAL IP_dataMem_inst.v FALSE
173+
// Retrieval info: GEN_FILE: TYPE_NORMAL IP_dataMem_bb.v TRUE
174+
// Retrieval info: GEN_FILE: TYPE_NORMAL IP_dataMem_syn.v TRUE
175+
// Retrieval info: LIB_FILE: altera_mf

0 commit comments

Comments
 (0)