16位RISC处理器的Verilog代码

在这个V.Erilog项目,16位的Verilog代码 risc. 处理器呈现。 

risc.处理器是根据其指令集设计的 哈佛-Type数据路径结构。然后,RISC处理器实现在 verilog. 并使用Xilinx Isim验证。


risc.处理器的Verilog代码

risc.的指令集 处理器:


A.内存访问指令
1.加载Word:
               LD WS,偏移量(RS1)WS:= MEM16 [RS1 + OFFSET]
2.存储字:
               ST RS2,偏移量(RS1)MEM16 [RS1 + OFFSET] = RS2

B.数据处理指令
1.补充:
               添加WS,RS1,RS2 WS:= RS1 + RS2
2.减去:
               子WS,RS1,RS2 WS:= RS1– rs2
3.逆变(1‘s complement):
               INV ws, rs1 ws:=!rs1
4.左侧偏移偏移:
               LSL WS,RS1,RS2 WS:= RS1<< rs2
5.逻辑转移右:
               LSR WS,RS1,RS2 WS:= RS1>> rs2
6.按位:
               和WS,RS1,RS2 WS:= Rs1• rs2
7.按位或:
             或WS,RS1,RS2 WS:= RS1 | RS2
8.设置小于:
             SLT WS,RS1,RS2 WS:= 1如果RS1< rs2; ws:=0 if rs1 ≥ rs2

C.控制流程说明
1.平等的分支:
               BEQ rs1, rs2, offset
               分支到(PC + 2 +(偏移量<< 1)) when rs1 = rs2

2.分支不等于:
             BNE RS1,RS2,偏移
             分支到(PC + 2 +(偏移量<< 1)) when rs1 != rs2

3.跳转:JMP偏移跳转到{PC [15:13],(偏移量<< 1)}

risc.的指令格式 处理器 :


risc.处理器的Verilog代码

处理器控制单元设计:


控制信号
操作说明
reg
DST.
alusrc.
MEMTO.
reg
reg
MEM.read.
MEM.
分支
露族
数据处理
1
0
0
1
0
0
0
00
0
LW.
0
1
1
1
1
0
0
10
0
sw
0
1
0
0
0
1
0
10
0
BEQ,BNE.
0
0
0
0
0
0
1
01
0
J
0
0
0
0
0
0
0
00
1


ALU控制单元设计:


alu控制
露族
OPCODE(十六进制)
alucnt.
alu运作
操作说明
10
XXXX.
000
添加
LW.,SW
01
XXXX.
001
BEQ,BNE.
00
0002
000
添加
D型:添加
00
0003
001
D型:子
00
0004
010
倒置
D型:反转
00
0005
011
LSL.
D型:LSL
00
0006
100
LSR.
D型:LSR
00
0007
101
D型:和
00
0008
110
或者
D型:或
00
0009
111
SLT.
D型:SLT



risc.处理器的Verilog代码:

1. Verilog代码 说明记忆 :

`include "Parameter.v"
// yl315.net 
// FPGA projects, VHDL projects, Verilog projects 
// Verilog code for RISC Processor 
// Verilog code for Instruction Memory
module Instruction_Memory(
 input[15:0] pc,
 output[15:0] instruction
);

 reg [`col - 1:0] memory [`row_i - 1:0];
 wire [3 : 0] rom_addr = pc[4 : 1];
 initial
 begin
  $readmemb("./test/test.prog", memory,0,14);
 end
 assign instruction =  memory[rom_addr]; 

endmodule

2. Verilog代码 注册文件:

`timescale 1ns / 1ps
// yl315.net 
// FPGA projects, VHDL projects, Verilog projects 
// Verilog code for RISC Processor 
// Verilog code for register file
module GPRs(
 input    clk,
 // write port
 input    reg_write_en,
 input  [2:0] reg_write_dest,
 input  [15:0] reg_write_data,
 //read port 1
 input  [2:0] reg_read_addr_1,
 output  [15:0] reg_read_data_1,
 //read port 2
 input  [2:0] reg_read_addr_2,
 output  [15:0] reg_read_data_2
);
 reg [15:0] reg_array [7:0];
 integer i;
 // write port
 //reg [2:0] i;
 initial begin
  for(i=0;i<8;i=i+1)
   reg_array[i] <= 16'd0;
 end
 always @ (posedge clk ) begin
   if(reg_write_en) begin
    reg_array[reg_write_dest] <= reg_write_data;
   end
 end
 

 assign reg_read_data_1 = reg_array[reg_read_addr_1];
 assign reg_read_data_2 = reg_array[reg_read_addr_2];


endmodule

3.数据内存的Verilog代码:

`include "Parameter.v"
// yl315.net 
// FPGA projects, VHDL projects, verilog. projects 
// Verilog code for RISC Processor 
// Verilog code for data Memory
module Data_Memory(
 input clk,
 // address input, shared by read and write port
 input [15:0]   mem_access_addr,
 
 // write port
 input [15:0]   mem_write_data,
 input     mem_write_en,
 input mem_read,
 // read port
 output [15:0]   mem_read_data
);

reg [`col - 1:0] memory [`row_d - 1:0];
integer f;
wire [2:0] ram_addr=mem_access_addr[2:0];
initial
 begin
  $readmemb("./test/test.data", memory);
  
  f = $fopen(`filename);
  $fmonitor(f, "time = %d\n", $time, 
  "\tmemory[0] = %b\n", memory[0],   
  "\tmemory[1] = %b\n", memory[1],
  "\tmemory[2] = %b\n", memory[2],
  "\tmemory[3] = %b\n", memory[3],
  "\tmemory[4] = %b\n", memory[4],
  "\tmemory[5] = %b\n", memory[5],
  "\tmemory[6] = %b\n", memory[6],
  "\tmemory[7] = %b\n", memory[7]);
  `simulation_time;
  $fclose(f);
 end
 
 always @(posedge clk) begin
  if (mem_write_en)
   memory[ram_addr] <= mem_write_data;
 end
 assign mem_read_data = (mem_read==1'b1) ? memory[ram_addr]: 16'd0; 

endmodule

4. ALU单位的Verilog代码:

// yl315.net 
// FPGA projects, VHDL projects, Verilog projects 
// Verilog code for RISC Processor 
// Verilog code for ALU
module ALU(
 input  [15:0] a,  //src1
 input  [15:0] b,  //src2
 input  [2:0] alu_control, //function sel
 
 output reg [15:0] result,  //result 
 output zero
    );

always @(*)
begin 
 case(alu_control)
 3'b000: result = a + b; // add
 3'b001: result = a - b; // sub
 3'b010: result = ~a;
 3'b011: result = a<<b;
 3'b100: result = a>>b;
 3'b101: result = a & b; // and
 3'b110: result = a | b; // or
 3'b111: begin if (a<b) result = 16'd1;
    else result = 16'd0;
    end
 default:result = a + b; // add
 endcase
end
assign zero = (result==16'd0) ? 1'b1: 1'b0;
 
endmodule

5. RISC处理器的ALU控制单元的Verilog代码:

`timescale 1ns / 1ps
//yl315.net: FPGA projects, Verilog projects, VHDL projects
// Verilog code for 16-bit RISC processor
// ALU_Control Verilog code
module alu_control( ALU_Cnt, ALUOp, Opcode);
 output reg[2:0] ALU_Cnt;
 input [1:0] ALUOp;
 input [3:0] Opcode;
 wire [5:0] ALUControlIn;
 assign ALUControlIn = {ALUOp,Opcode};
 always @(ALUControlIn)
 casex (ALUControlIn)
   6'b10XXXX.: ALU_Cnt=3'b000;
   6'b01XXXX.: ALU_Cnt=3'b001;
   6'b000010: ALU_Cnt=3'b000;
   6'b000011: ALU_Cnt=3'b001;
   6'b000100: ALU_Cnt=3'b010;
   6'b000101: ALU_Cnt=3'b011;
   6'b000110: ALU_Cnt=3'b100;
   6'b000111: ALU_Cnt=3'b101;
   6'b001000: ALU_Cnt=3'b110;
   6'b001001: ALU_Cnt=3'b111;
  default: ALU_Cnt=3'b000;
  endcase
endmodule

6. RISC处理器的DataPath verilog代码:

`timescale 1ns / 1ps
// yl315.net 
// FPGA projects, VHDL projects, Verilog projects 
// Verilog code for RISC Processor 
// Verilog code for Data Path of the processor
module Datapath_Unit(
 input clk,
 input jump,beq,mem_read,mem_write,alu_src,reg_dst,mem_to_reg,reg_write,bne,
 input[1:0] alu_op,
 output[3:0] opcode
);
 reg  [15:0] pc_current;
 wire [15:0] pc_next,pc2;
 wire [15:0] instr;
 wire [2:0] reg_write_dest;
 wire [15:0] reg_write_data;
 wire [2:0] reg_read_addr_1;
 wire [15:0] reg_read_data_1;
 wire [2:0] reg_read_addr_2;
 wire [15:0] reg_read_data_2;
 wire [15:0] ext_im,read_data2;
 wire [2:0] ALU_Control;
 wire [15:0] ALU_out;
 wire zero_flag;
 wire [15:0] PC_j, PC_beq, PC_2beq,PC_2bne,PC_bne;
 wire beq_control;
 wire [12:0] jump_shift;
 wire [15:0] mem_read_data;
 // PC 
 initial begin
  pc_current <= 16'd0;
 end
 always @(posedge clk)
 begin 
   pc_current <= pc_next;
 end
 assign pc2 = pc_current + 16'd2;
 // instruction memory
 Instruction_Memory im(.pc(pc_current),.instruction(instr));
 // jump shift left 2
 assign jump_shift = {instr[11:0],1'b0};
 // multiplexer regdest
 assign reg_write_dest = (reg_dst==1'b1) ? instr[5:3] :instr[8:6];
 // register file
 assign reg_read_addr_1 = instr[11:9];
 assign reg_read_addr_2 = instr[8:6];

 // GENERAL PURPOSE REGISTERs
 GPRs reg_file
 (
  .clk(clk),
  .reg_write_en(reg_write),
  .reg_write_dest(reg_write_dest),
  .reg_write_data(reg_write_data),
  .reg_read_addr_1(reg_read_addr_1),
  .reg_read_data_1(reg_read_data_1),
  .reg_read_addr_2(reg_read_addr_2),
  .reg_read_data_2(reg_read_data_2)
 );
 // immediate extend
 assign ext_im = {{10{instr[5]}},instr[5:0]};  
 // ALU control unit
 alu_control ALU_Control_unit(.ALUOp(alu_op),.Opcode(instr[15:12]),.ALU_Cnt(ALU_Control));
 // multiplexer alu_src
 assign read_data2 = (alu_src==1'b1) ? ext_im : reg_read_data_2;
 // ALU 
 ALU alu_unit(.a(reg_read_data_1),.b(read_data2),.alu_control(ALU_Control),.result(ALU_out),.zero(zero_flag));
 // PC beq add
 assign PC_beq = pc2 + {ext_im[14:0],1'b0};
 assign PC_bne = pc2 + {ext_im[14:0],1'b0};
 // beq control
 assign beq_control = beq & zero_flag;
 assign bne_control = bne & (~zero_flag);
 // PC_beq
 assign PC_2beq = (beq_control==1'b1) ? PC_beq : pc2;
 // PC_bne
 assign PC_2bne = (bne_control==1'b1) ? PC_bne : PC_2beq;
 // PC_j
 assign PC_j = {pc2[15:13],jump_shift};
 // PC_next
 assign pc_next = (jump == 1'b1) ? PC_j :  PC_2bne;

 /// Data memory
  Data_Memory dm
   (
    .clk(clk),
    .mem_access_addr(ALU_out),
    .mem_write_data(reg_read_data_2),
    .mem_write_en(mem_write),
    .mem_read(mem_read),
    .mem_read_data(mem_read_data)
   );
 
 // write back
 assign reg_write_data = (mem_to_reg == 1'b1)?  mem_read_data: ALU_out;
 // output to control unit
 assign opcode = instr[15:12];
endmodule

7. RISC处理器控制单元的Verilog代码:

`timescale 1ns / 1ps
// yl315.net 
// FPGA projects, VHDL projects, Verilog projects 
// Verilog code for RISC Processor 
// Verilog code for Control Unit 
module Control_Unit(
      input[3:0] opcode,
      output reg[1:0] alu_op,
      output reg jump,beq,bne,mem_read,mem_write,alu_src,reg_dst,mem_to_reg,reg_write    
    );


always @(*)
begin
 case(opcode) 
 4'b0000:  // LW
   begin
    reg_dst = 1'b0;
    alu_src = 1'b1;
    mem_to_reg = 1'b1;
    reg_write = 1'b1;
    mem_read = 1'b1;
    mem_write = 1'b0;
    beq = 1'b0;
    bne = 1'b0;
    alu_op = 2'b10;
    jump = 1'b0;   
   end
 4'b0001:  // SW
   begin
    reg_dst = 1'b0;
    alu_src = 1'b1;
    mem_to_reg = 1'b0;
    reg_write = 1'b0;
    mem_read = 1'b0;
    mem_write = 1'b1;
    beq = 1'b0;
    bne = 1'b0;
    alu_op = 2'b10;
    jump = 1'b0;   
   end
 4'b0010:  // data_processing
   begin
    reg_dst = 1'b1;
    alu_src = 1'b0;
    mem_to_reg = 1'b0;
    reg_write = 1'b1;
    mem_read = 1'b0;
    mem_write = 1'b0;
    beq = 1'b0;
    bne = 1'b0;
    alu_op = 2'b00;
    jump = 1'b0;   
   end
 4'b0011:  // data_processing
   begin
    reg_dst = 1'b1;
    alu_src = 1'b0;
    mem_to_reg = 1'b0;
    reg_write = 1'b1;
    mem_read = 1'b0;
    mem_write = 1'b0;
    beq = 1'b0;
    bne = 1'b0;
    alu_op = 2'b00;
    jump = 1'b0;   
   end
 4'b0100:  // data_processing
   begin
    reg_dst = 1'b1;
    alu_src = 1'b0;
    mem_to_reg = 1'b0;
    reg_write = 1'b1;
    mem_read = 1'b0;
    mem_write = 1'b0;
    beq = 1'b0;
    bne = 1'b0;
    alu_op = 2'b00;
    jump = 1'b0;   
   end
 4'b0101:  // data_processing
   begin
    reg_dst = 1'b1;
    alu_src = 1'b0;
    mem_to_reg = 1'b0;
    reg_write = 1'b1;
    mem_read = 1'b0;
    mem_write = 1'b0;
    beq = 1'b0;
    bne = 1'b0;
    alu_op = 2'b00;
    jump = 1'b0;   
   end
 4'b0110:  // data_processing
   begin
    reg_dst = 1'b1;
    alu_src = 1'b0;
    mem_to_reg = 1'b0;
    reg_write = 1'b1;
    mem_read = 1'b0;
    mem_write = 1'b0;
    beq = 1'b0;
    bne = 1'b0;
    alu_op = 2'b00;
    jump = 1'b0;   
   end
 4'b0111:  // data_processing
   begin
    reg_dst = 1'b1;
    alu_src = 1'b0;
    mem_to_reg = 1'b0;
    reg_write = 1'b1;
    mem_read = 1'b0;
    mem_write = 1'b0;
    beq = 1'b0;
    bne = 1'b0;
    alu_op = 2'b00;
    jump = 1'b0;   
   end
 4'b1000:  // data_processing
   begin
    reg_dst = 1'b1;
    alu_src = 1'b0;
    mem_to_reg = 1'b0;
    reg_write = 1'b1;
    mem_read = 1'b0;
    mem_write = 1'b0;
    beq = 1'b0;
    bne = 1'b0;
    alu_op = 2'b00;
    jump = 1'b0;   
   end
 4'b1001:  // data_processing
   begin
    reg_dst = 1'b1;
    alu_src = 1'b0;
    mem_to_reg = 1'b0;
    reg_write = 1'b1;
    mem_read = 1'b0;
    mem_write = 1'b0;
    beq = 1'b0;
    bne = 1'b0;
    alu_op = 2'b00;
    jump = 1'b0;   
   end
 4'b1011:  // BEQ
   begin
    reg_dst = 1'b0;
    alu_src = 1'b0;
    mem_to_reg = 1'b0;
    reg_write = 1'b0;
    mem_read = 1'b0;
    mem_write = 1'b0;
    beq = 1'b1;
    bne = 1'b0;
    alu_op = 2'b01;
    jump = 1'b0;   
   end
 4'b1100:  // BNE
   begin
    reg_dst = 1'b0;
    alu_src = 1'b0;
    mem_to_reg = 1'b0;
    reg_write = 1'b0;
    mem_read = 1'b0;
    mem_write = 1'b0;
    beq = 1'b0;
    bne = 1'b1;
    alu_op = 2'b01;
    jump = 1'b0;   
   end
 4'b1101:  // J
   begin
    reg_dst = 1'b0;
    alu_src = 1'b0;
    mem_to_reg = 1'b0;
    reg_write = 1'b0;
    mem_read = 1'b0;
    mem_write = 1'b0;
    beq = 1'b0;
    bne = 1'b0;
    alu_op = 2'b00;
    jump = 1'b1;   
   end   
 default: begin
    reg_dst = 1'b1;
    alu_src = 1'b0;
    mem_to_reg = 1'b0;
    reg_write = 1'b1;
    mem_read = 1'b0;
    mem_write = 1'b0;
    beq = 1'b0;
    bne = 1'b0;
    alu_op = 2'b00;
    jump = 1'b0; 
   end
 endcase
 end

endmodule

8. 16位RISC处理器的Verilog代码:

`timescale 1ns / 1ps
// yl315.net 
// FPGA projects, VHDL projects, Verilog projects 
// Verilog code for RISC Processor 

module Risc_16_bit(
 input clk
);
 wire jump,bne,beq,mem_read,mem_write,alu_src,reg_dst,mem_to_reg,reg_write;
 wire[1:0] alu_op;
 wire [3:0] opcode;
 // Datapath
 Datapath_Unit DU
 (
  .clk(clk),
  .jump(jump),
  .beq(beq),
  .mem_read(mem_read),
  .mem_write(mem_write),
  .alu_src(alu_src),
  .reg_dst(reg_dst),
  .mem_to_reg(mem_to_reg),
  .reg_write(reg_write),
  .bne(bne),
  .alu_op(alu_op),
  .opcode(opcode)
 );
 // control unit
 Control_Unit control
 (
  .opcode(opcode),
  .reg_dst(reg_dst),
  .mem_to_reg(mem_to_reg),
  .alu_op(alu_op),
  .jump(jump),
  .bne(bne),
  .beq(beq),
  .mem_read(mem_read),
  .mem_write(mem_write),
  .alu_src(alu_src),
  .reg_write(reg_write)
 );

endmodule

9. 16位RISC处理器的Verilog TestBench代码:

`timescale 1ns / 1ps
`include "Parameter.v"
// yl315.net 
// FPGA projects, VHDL projects, verilog. projects 
// Verilog code for RISC Processor 
// Verilog testbench code to test the processor
module test_Risc_16_bit;

 // Inputs
 reg clk;

 // Instantiate the Unit Under Test (UUT)
 Risc_16_bit uut (
  .clk(clk)
 );

 initial 
  begin
   clk <=0;
   `simulation_time;
   $finish;
  end

 always 
  begin
   #5 clk = ~clk;
  end

endmodule

参数文件:

`ifndef PARAMETER_H_
`define PARAMETER_H_
// yl315.net 
// FPGA projects, VHDL projects, Verilog projects 
// Verilog code for RISC Processor 
// Parameter file
`define col 16 // 16 bits instruction memory, data memory
`define row_i 15 // instruction memory, instructions number, this number can be changed. Adding more instructions to verify your design is a good idea.
`define row_d 8 // The number of data in data memory. We only use 8 data. Do not change this number. You can change the value of each data inside test.data file. Total number is fixed at 8. 
`define filename "./test/50001111_50001212.o"
`define simulation_time #160

`endif

提供了16位RISC处理器所需的所有Verilog代码。现在,您只需要创建一个test.data(数据存储器的初始内容)和test.prog(侦听存储器)。然后,运行模拟以查看过程如何在模拟波形和内存文件上工作。 

示例指令内存文件: 

0000_0100_0000_0000 // load R0 <- Mem(R2 + 0)
0000_0100_0100_0001 // load R1 <- Mem(R2 + 1)
0010_0000_0101_0000 // Add R2 <- R0 + R1
0001_0010_1000_0000 // Store Mem(R1 + 0) <- R2
0011_0000_0101_0000 // sub R2 <- R0 - R1
0100_0000_0101_0000 // invert R2 <- !R0 
0101_0000_0101_0000 // logical shift left R2 <- R0<<R1 
0110_0000_0101_0000 // logical shift right R2 <- R0>>R1 
0111_0000_0101_0000 // AND R2<- R0 AND R1 
1000_0000_0101_0000 // OR R2<- R0 OR R1 
1001_0000_0101_0000 // SLT R2 <- 1 if R0 < R1 
0010_0000_0000_0000 // Add R0 <- R0 + R0
1011_0000_0100_0001 // BEQ branch to jump if R0=R1, PCnew= PC+2+offset<<1 = 28 => offset = 1
1100_0000_0100_0000 // BNE branch to jump if R0!=R1, PCnew= PC+2+offset<<1 = 28 => offset = 0
1101_0000_0000_0000 // J jump to the beginning address

示例数据内存文件:

0000_0000_0000_0001
0000_0000_0000_0010
0000_0000_0000_0001
0000_0000_0000_0010
0000_0000_0000_0001
0000_0000_0000_0010
0000_0000_0000_0001
0000_0000_0000_0010
你可能喜欢这个:
MIPS处理器在VHDL中
16位单循环MIPS处理器的Verilog代码
verilog.中的32位5级流水线MIPS处理器(第1部分)
verilog.中的32位5级流水线MIPS处理器(Part-2)
verilog.中的32位5级流水线MIPS处理器(第3部分)

推荐的 Verilog projects:
2. FIFO记忆的Verilog代码
3. 16位单循环MIPS处理器的Verilog代码
4. verilog. HDL中的可编程数字延迟计时器
5. 数字电路中基本逻辑组件的Verilog代码
6. 32位无符号分频器的Verilog代码
7. 用于固定点矩阵乘法的Verilog代码
8. 在Verilog HDL中的板牌识别
9. 携带外观前方乘法器的Verilog代码
10。 微控制器的Verilog代码
11. 4x4乘法器的Verilog代码
12. 停车系统的Verilog代码
13。 使用Verilog HDL对FPGA的图像处理
14。 如何使用Verilog HDL将文本文件加载到FPGA中
15。 交通灯控制器的Verilog代码
16。 FPGA闹钟的Verilog代码
17。 比较器设计的Verilog代码
18。 VERILOG代码D触发器
19。 完整加法器的Verilog代码
20。 与测试台的计数器的Verilog代码
21。 16位RISC处理器的Verilog代码
22。 FPGA上的按钮的Verilog代码
23。 如何为双向/ inout端口编写Verilog TestBench
28。 解码器的Verilog代码
29。 多路复用器的Verilog代码
30.  Verilog中的n位加法器设计
31。 verilog. vs vhdl.:通过示例解释
32。 FPGA时钟分频器的Verilog代码
33。 如何在Verilog中生成时钟使能信号
34。 PWM生成器的Verilog代码
35。 verilog.编码VS软件编程
36。 Moore FSM序列检测器的Verilog代码
37。 Basys 3 FPGA上的7段显示控制器的Verilog代码
FPGA Verilog VHDL课程

27评论:

  1. alu_control_unit模块丢失!

    回复删除
  2. 在数据路径中仍缺少ALU和ALU控制的描述。

    回复删除
  3. 检查给定表格以了解ALU和ALU控制单元的功能。

    回复删除
  4. 要在像斯巴达这样的FPGA模块上植入它,请您能让抬头

    回复删除
  5. 哟只能解释一下test.prog和test.data,我们应该在哪里创建它,也是关于.o文件。
    提前致谢。

    回复删除
    答案
    1. 上面给出了这些文件。只需创建具有相同名称的文件并将内容复制到这些文件中。

      删除
  6. 你可以发给我这个代码吗?
    我的邮件是
    [email protected]

    回复删除
  7. 你可以发送8bit RISC处理器代码吗?

    回复删除
  8. 谢谢上面的代码。我测试了它,完美作品。我现在概述了。再次感谢。

    回复删除
    答案
    1. 很高兴听你这样说。你're welcome.

      删除
    2. 能否请发送代码我已经测试的代码,它显示出一些错误我使用的工具是Xilinx 14.3版本,仍未显示输出

      删除
  9. 如何创建Test.data(数据存储器的初始内容)和test.prog(侦听存储器)。

    回复删除
    答案
    1. 对于指令存储器,您需要将指令转换为机器代码。然后,将数据放入指令存储器中。有2个用于数据和指令内存的示例文件。你可以参考它。

      删除
  10. 我没有得到输出,请告诉我如何完全执行它

    回复删除
    答案
    1. 检查寄存器和内存内容以进行验证,或者将其中一些人作为输出拍摄,以便在仿真波形上看到

      删除
  11. 您能否为每个街区提供FSM。

    回复删除
  12. 你可以用32条指令给我发给第5架子管道64位RISC处理器的代码吗?

    回复删除
  13. 如何创建test.data和test.prog文件,我们应该在哪里创建它?
    他们应该是文本文件吗?

    回复删除
  14. 我在Verilog中的新功能,使用Quartus II进行仿真。在test.prog中面对语法错误,但我不'得到它在哪里错误。我已经复制了您的exame,并保存了命名test.prog

    回复删除
  15. 在Vivado的实施表示,设计是空的。如何解决它?

    回复删除
  16. 你能解释rs1,rs2和ws的缩写吗?

    回复删除
  17. 主席先生,你能告诉我你使用哪个模拟器?我试过Xilinx Vivado ...但我没有了解在哪里检查该输出.data和.prog文件。

    回复删除
    答案
    1. 它可用于任何Verilog模拟器。您需要创建.data + .prog文件'test'项目文件夹中的文件夹。

      删除
  18. 你能解释为什么在指导记忆部分中的原因
    线[3:0] rom_addr = pc [4:1];
    你没有分配PC [3:0]?为什么UHV在分配时遗漏了第0位PC?

    回复删除
    答案
    1. 每个指令/内存数据宽度有16位或2个字节。 PC计算在2.'■为什么只使用PC [4:1]从ROM获取指令。

      删除

趋势FPGA项目