Skip to content

Commit 257c6fc

Browse files
committed
IP Core
1 parent 2e6376f commit 257c6fc

File tree

114 files changed

+9029
-241
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+9029
-241
lines changed

MipsCPU.xise

+31-6
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,19 @@
5252
<association xil_pn:name="Implementation" xil_pn:seqID="3"/>
5353
</file>
5454
<file xil_pn:name="mips.v" xil_pn:type="FILE_VERILOG">
55-
<association xil_pn:name="BehavioralSimulation" xil_pn:seqID="12"/>
55+
<association xil_pn:name="BehavioralSimulation" xil_pn:seqID="13"/>
5656
<association xil_pn:name="Implementation" xil_pn:seqID="12"/>
5757
</file>
5858
<file xil_pn:name="insRom.v" xil_pn:type="FILE_VERILOG">
59-
<association xil_pn:name="BehavioralSimulation" xil_pn:seqID="13"/>
59+
<association xil_pn:name="BehavioralSimulation" xil_pn:seqID="0"/>
6060
<association xil_pn:name="Implementation" xil_pn:seqID="13"/>
6161
</file>
6262
<file xil_pn:name="cpu.v" xil_pn:type="FILE_VERILOG">
63-
<association xil_pn:name="BehavioralSimulation" xil_pn:seqID="14"/>
63+
<association xil_pn:name="BehavioralSimulation" xil_pn:seqID="16"/>
6464
<association xil_pn:name="Implementation" xil_pn:seqID="14"/>
6565
</file>
6666
<file xil_pn:name="cpu_tb.v" xil_pn:type="FILE_VERILOG">
67-
<association xil_pn:name="BehavioralSimulation" xil_pn:seqID="15"/>
67+
<association xil_pn:name="BehavioralSimulation" xil_pn:seqID="17"/>
6868
<association xil_pn:name="PostMapSimulation" xil_pn:seqID="24"/>
6969
<association xil_pn:name="PostRouteSimulation" xil_pn:seqID="24"/>
7070
<association xil_pn:name="PostTranslateSimulation" xil_pn:seqID="24"/>
@@ -74,9 +74,30 @@
7474
<association xil_pn:name="Implementation" xil_pn:seqID="8"/>
7575
</file>
7676
<file xil_pn:name="ram.v" xil_pn:type="FILE_VERILOG">
77-
<association xil_pn:name="BehavioralSimulation" xil_pn:seqID="11"/>
77+
<association xil_pn:name="BehavioralSimulation" xil_pn:seqID="12"/>
7878
<association xil_pn:name="Implementation" xil_pn:seqID="11"/>
7979
</file>
80+
<file xil_pn:name="control.v" xil_pn:type="FILE_VERILOG">
81+
<association xil_pn:name="BehavioralSimulation" xil_pn:seqID="11"/>
82+
<association xil_pn:name="Implementation" xil_pn:seqID="108"/>
83+
</file>
84+
<file xil_pn:name="ipcore_dir/instMem_ip.xco" xil_pn:type="FILE_COREGEN">
85+
<association xil_pn:name="BehavioralSimulation" xil_pn:seqID="14"/>
86+
<association xil_pn:name="Implementation" xil_pn:seqID="109"/>
87+
</file>
88+
<file xil_pn:name="ipcore_dir/clk_ip.xco" xil_pn:type="FILE_COREGEN">
89+
<association xil_pn:name="BehavioralSimulation" xil_pn:seqID="15"/>
90+
<association xil_pn:name="Implementation" xil_pn:seqID="117"/>
91+
</file>
92+
<file xil_pn:name="implemention.ucf" xil_pn:type="FILE_UCF">
93+
<association xil_pn:name="Implementation" xil_pn:seqID="123"/>
94+
</file>
95+
<file xil_pn:name="ipcore_dir/instMem_ip.xise" xil_pn:type="FILE_COREGENISE">
96+
<association xil_pn:name="Implementation" xil_pn:seqID="110"/>
97+
</file>
98+
<file xil_pn:name="ipcore_dir/clk_ip.xise" xil_pn:type="FILE_COREGENISE">
99+
<association xil_pn:name="Implementation" xil_pn:seqID="118"/>
100+
</file>
80101
</files>
81102

82103
<properties>
@@ -263,6 +284,7 @@
263284
<property xil_pn:name="Package" xil_pn:value="csg324" xil_pn:valueState="default"/>
264285
<property xil_pn:name="Perform Advanced Analysis" xil_pn:value="false" xil_pn:valueState="default"/>
265286
<property xil_pn:name="Perform Advanced Analysis Post Trace" xil_pn:value="false" xil_pn:valueState="default"/>
287+
<property xil_pn:name="Perform Timing-Driven Packing and Placement" xil_pn:value="false" xil_pn:valueState="default"/>
266288
<property xil_pn:name="Place &amp; Route Effort Level (Overall)" xil_pn:value="High" xil_pn:valueState="default"/>
267289
<property xil_pn:name="Place And Route Mode" xil_pn:value="Route Only" xil_pn:valueState="default"/>
268290
<property xil_pn:name="Place MultiBoot Settings into Bitstream virtex7" xil_pn:value="false" xil_pn:valueState="default"/>
@@ -338,6 +360,7 @@
338360
<property xil_pn:name="Structure window" xil_pn:value="true" xil_pn:valueState="default"/>
339361
<property xil_pn:name="Synthesis Tool" xil_pn:value="XST (VHDL/Verilog)" xil_pn:valueState="default"/>
340362
<property xil_pn:name="Target Simulator" xil_pn:value="Modelsim-PE Verilog" xil_pn:valueState="default"/>
363+
<property xil_pn:name="Target UCF File Name" xil_pn:value="implemention.ucf" xil_pn:valueState="non-default"/>
341364
<property xil_pn:name="Timing Mode Map" xil_pn:value="Performance Evaluation" xil_pn:valueState="default"/>
342365
<property xil_pn:name="Timing Mode Par" xil_pn:value="Performance Evaluation" xil_pn:valueState="default"/>
343366
<property xil_pn:name="Top-Level Module Name in Output Netlist" xil_pn:value="" xil_pn:valueState="default"/>
@@ -394,7 +417,9 @@
394417
<property xil_pn:name="PROP_intWorkingDirUsed" xil_pn:value="No" xil_pn:valueState="non-default"/>
395418
</properties>
396419

397-
<bindings/>
420+
<bindings>
421+
<binding xil_pn:location="/cpu" xil_pn:name="implemention.ucf"/>
422+
</bindings>
398423

399424
<libraries/>
400425

control.v

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
`timescale 1ns / 1ps
2+
//////////////////////////////////////////////////////////////////////////////////
3+
// Company:
4+
// Engineer:
5+
//
6+
// Create Date: 10:39:48 12/11/2015
7+
// Design Name:
8+
// Module Name: control
9+
// Project Name:
10+
// Target Devices:
11+
// Tool versions:
12+
// Description:
13+
//
14+
// Dependencies:
15+
//
16+
// Revision:
17+
// Revision 0.01 - File Created
18+
// Additional Comments:
19+
//
20+
//////////////////////////////////////////////////////////////////////////////////
21+
module control(
22+
/*
23+
* control_output[5] -> writeback
24+
* control_output[4] -> memory
25+
* control_output[3] -> execute
26+
* control_output[2] -> insDecode
27+
* control_output[1] -> insFetch
28+
* control_output[0] -> PC
29+
*/
30+
input rst,
31+
input insDecode_pause,
32+
input execute_pause,
33+
output reg[5:0] control_output
34+
);
35+
36+
always @ (*) begin
37+
if(rst == 1) begin
38+
control_output <= 0;
39+
end else if(execute_pause == 1)
40+
control_output <= 6'b001111;
41+
else if(insDecode_pause == 1)
42+
control_output <= 6'b000111;
43+
end
44+
45+
endmodule

cpu.v

+14-6
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,19 @@ module cpu(
3333
wire[31:0] ram_data_output;
3434
wire[3:0] ram_select_output;
3535
wire ram_write_enabler;
36+
37+
wire clk0;
38+
39+
clk_ip clk_ip0(
40+
.CLK_IN1(clk),
41+
.CLK_OUT1(clk0)
42+
);
43+
3644
//wire ram_enabler;
3745

3846
mips mips0(
3947
.rst(rst),
40-
.clk(clk),
48+
.clk(clk0),
4149
.ins_input(inst),
4250
.addr_output(instAddr),
4351
.enabler_output(enabler),
@@ -50,14 +58,14 @@ module cpu(
5058
.ram_enabler(ram_enabler)
5159
);
5260

53-
instRom instRom0(
54-
.enabler(enabler),
55-
.addr(instAddr),
56-
.inst(inst)
61+
instMem_ip instRom0(
62+
//.enabler(enabler),
63+
.a(instAddr[11:2]),
64+
.spo(inst)
5765
);
5866

5967
ram ram0(
60-
.clk(clk),
68+
.clk(clk0),
6169
.enabler(ram_enabler),
6270
.write_enabler(ram_write_enabler),
6371
.addr(ram_addr_output),

cpu_tb.v

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@ module cpu_tb;
2727
// Inputs
2828
reg rst;
2929
reg clk;
30+
wire ram_enabler;
3031

3132
// Instantiate the Unit Under Test (UUT)
3233
cpu uut (
3334
.rst(rst),
34-
.clk(clk)
35+
.clk(clk),
36+
.ram_enabler(ram_enabler)
3537
);
3638

3739
initial begin

execute.v

+5-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ module execute(
5454
input wire[31:0] insDecode2execute_ins,
5555
output wire[7:0] aluop_output,
5656
output wire[31:0] mem_addr_output,
57-
output wire[31:0] regOp2_output
57+
output wire[31:0] regOp2_output,
58+
59+
output execute_pause_output
5860
);
5961

6062
reg [31:0] opOut;
@@ -95,6 +97,8 @@ module execute(
9597

9698
assign regOp2_output = regOp2;
9799

100+
assign execute_pause_output = 0;
101+
98102
always @ (*) begin
99103
if (rst == 1'b1) begin
100104
arch_answer <= 0;

execute2memory.v

+4-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ module execute2memory(
4242
input wire[31:0] regOp2,
4343
output reg[7:0] aluop_output,
4444
output reg[31:0] mem_addr_output,
45-
output reg[31:0] regOp2_output
45+
output reg[31:0] regOp2_output,
46+
47+
input wire[5:0] control
4648
);
4749

4850
always @ (posedge clk) begin
@@ -53,7 +55,7 @@ module execute2memory(
5355
execute2memory_HILO_enabler <= 0;
5456
execute2memory_HILO_HI <= 0;
5557
execute2memory_HILO_LO <= 0;
56-
end else begin
58+
end else if(control[3] == 0) begin
5759
dest_addr_output <= dest_addr;
5860
write_or_not_output <= write_or_not;
5961
wdata_output <= wdata;

0 commit comments

Comments
 (0)