-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtb_core.v
More file actions
59 lines (51 loc) · 1 KB
/
tb_core.v
File metadata and controls
59 lines (51 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* A RISC-V core designed to use minimal area.
Aim is to support RV32E
*/
module tb_core (
input clk,
input rstn,
input [31:0] next_instr,
input [31:0] instr,
input [2:0] cycle,
output [31:0] data_out,
output rs2_out,
output branch
);
`ifdef COCOTB_SIM
initial begin
$dumpfile ("nanoV.vcd");
$dumpvars (0, tb_core);
#1;
end
`endif
reg [4:0] counter;
always @(posedge clk)
if (!rstn) begin
counter <= 0;
end else begin
counter <= counter + 1;
end
wire shift_data_out = 1'b0;
wire pc = 1'b0;
wire shift_pc;
wire data_in = 1'b0;
wire ext_data_in = 1'b0;
wire use_ext_data_in = 1'b0;
nanoV_core core (
clk,
rstn,
next_instr[30:2],
instr[31:2],
cycle,
counter,
pc,
data_in,
ext_data_in,
use_ext_data_in,
shift_data_out,
shift_pc,
data_out,
rs2_out,
branch
);
endmodule