-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProcessor.v
More file actions
78 lines (72 loc) · 1.63 KB
/
Processor.v
File metadata and controls
78 lines (72 loc) · 1.63 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 17:38:44 04/09/2019
// Design Name:
// Module Name: RISC_8bit
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module RISC_8bit(input clk , output reg[7:0] led , input [7:0] sw
);
wire jump_neq,rom_read,rom_write,alu_select,sel_dst_reg,rom_to_reg,write_reg,write_strobe,read_strobe;
wire[1:0] output_ALU;
wire [2:0] opcode;
wire [7:0] output_port;
reg [7:0] input_port;
initial
begin
input_port <= 8'b0;
led <= 8'b0;
end
always @ (posedge clk) begin
input_port <= sw;
end
Control_Unit Control_Path
(
.opcode(opcode),
.output_ALU(output_ALU),
.sel_dst_reg(sel_dst_reg),
.rom_to_reg(rom_to_reg),
.write_reg(write_reg),
.jump_neq(jump_neq),
.rom_read(rom_read),
.rom_write(rom_write),
.alu_select(alu_select),
.write_strobe(write_strobe),
.read_strobe(read_strobe)
);
Datapath_Unit Data_Path
(
.clk(clk),
.opcode(opcode),
.output_port(output_port),
.input_port(input_port),
.write_strobe(write_strobe),
.read_strobe(read_strobe),
.rom_read(rom_read),
.rom_write(rom_write),
.alu_select(alu_select),
.sel_dst_reg(sel_dst_reg),
.rom_to_reg(rom_to_reg),
.write_reg(write_reg),
.jump_neq(jump_neq),
.output_ALU(output_ALU)
);
always @ (posedge clk) begin
if (write_strobe == 1'b1) begin
led <= output_port;
end
end
endmodule