mirror of
https://github.com/MPSU/APS.git
synced 2025-09-15 17:20:10 +00:00
Обновление тестбенчей
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Project Name : Architectures of Processor Systems (APS) lab work
|
||||
* File : alu_riscv.sv
|
||||
* File : alu.sv
|
||||
* Organization : National Research University of Electronic Technology (MIET)
|
||||
* Department : Institute of Microdevices and Control Systems
|
||||
* Author(s) : Alexey Kozin
|
||||
@@ -10,22 +10,22 @@ See LICENSE file for licensing details.
|
||||
* ------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
parameter ALUOP_W = 5;
|
||||
parameter OP_W = 32;
|
||||
parameter SHIFT_W = $clog2(OP_W);
|
||||
parameter STAGE_LEN = OP_W+1;
|
||||
parameter HASH_LEN = 1000;
|
||||
parameter START_CODING = 10366;
|
||||
parameter START_MUX = START_CODING+100;
|
||||
|
||||
module alu_riscv (
|
||||
input logic [ALUOP_W-1:0] alu_op_i,
|
||||
input logic [OP_W-1:0] a_i,
|
||||
input logic [OP_W-1:0] b_i,
|
||||
output logic [OP_W-1:0] result_o,
|
||||
output logic flag_o
|
||||
module alu (
|
||||
input logic [4:0] alu_op_i,
|
||||
input logic [31:0] a_i,
|
||||
input logic [31:0] b_i,
|
||||
output logic [31:0] result_o,
|
||||
output logic flag_o
|
||||
);
|
||||
|
||||
localparam ALUOP_W = 5;
|
||||
localparam OP_W = 32;
|
||||
localparam SHIFT_W = $clog2(OP_W);
|
||||
localparam STAGE_LEN = OP_W+1;
|
||||
localparam HASH_LEN = 1000;
|
||||
localparam START_CODING = 10366;
|
||||
localparam START_MUX = START_CODING+100;
|
||||
|
||||
genvar i, j, k;
|
||||
|
||||
logic [OP_W-1:0] skjfbsbgisg [0:STAGE_LEN-1];
|
||||
|
@@ -1,54 +0,0 @@
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Project Name : Architectures of Processor Systems (APS) lab work
|
||||
* Organization : National Research University of Electronic Technology (MIET)
|
||||
* Department : Institute of Microdevices and Control Systems
|
||||
* Author(s) : Nikita Bulavin
|
||||
* Email(s) : nekkit6@edu.miet.ru
|
||||
|
||||
See https://github.com/MPSU/APS/blob/master/LICENSE file for licensing details.
|
||||
* ------------------------------------------------------------------------------
|
||||
*/
|
||||
module data_mem (
|
||||
input logic clk_i,
|
||||
input logic [31:0] addr_i,
|
||||
input logic [31:0] write_data_i,
|
||||
input logic write_enable_i,
|
||||
input logic mem_req_i,
|
||||
output logic [31:0] read_data_o
|
||||
);
|
||||
|
||||
`define akjsdnnaskjdndat $clog2(128)
|
||||
`define cdyfguvhbjnmkdat $clog2(`akjsdnnaskjdndat)
|
||||
`define qwenklfsaklasddat $clog2(`cdyfguvhbjnmkdat)
|
||||
`define asdasdhkjasdsadat (34>>`cdyfguvhbjnmkdat)
|
||||
|
||||
logic [31:0] RAM [0:4095];
|
||||
logic [31:0] addr;
|
||||
assign addr = {20'b0, addr_i[13:2]};
|
||||
|
||||
always_ff @(posedge clk_i) begin
|
||||
if(write_enable_i&mem_req_i) RAM[addr[13'o10+13'b101:'hBA & 'h45]][{5{1'b1}}:{3'd7,2'b00}] <= write_data_i['h1f:'h1c];
|
||||
if(write_enable_i&mem_req_i) RAM[addr[13'o10+13'b101:'hBA & 'h45]][19:{1'b1,4'h0}] <= write_data_i[42-23-:`asdasdhkjasdsadat];
|
||||
if(write_enable_i&mem_req_i) RAM[addr[13'o10+13'b101:'hBA & 'h45]][{3{1'b1}}:{1'b1,2'h0}] <= write_data_i[`akjsdnnaskjdndat-:`asdasdhkjasdsadat];
|
||||
if(write_enable_i&mem_req_i) RAM[addr[13'o10+13'b101:'hBA & 'h45]][23:{{2{2'b10}},1'b0}] <= write_data_i[42-19-:`asdasdhkjasdsadat];
|
||||
if(write_enable_i&mem_req_i) RAM[addr[13'o10+13'b101:'hBA & 'h45]][27:{2'b11,3'b000}] <= write_data_i['h1b:'h18];
|
||||
if(write_enable_i&mem_req_i) RAM[addr[13'o10+13'b101:'hBA & 'h45]][11:{1'b1,{3{1'b0}}}] <= write_data_i[`akjsdnnaskjdndat+`asdasdhkjasdsadat:(`akjsdnnaskjdndat+`asdasdhkjasdsadat)-`cdyfguvhbjnmkdat];
|
||||
if(write_enable_i&mem_req_i) RAM[addr[13'o10+13'b101:'hBA & 'h45]][{2{1'b1}}:{3{1'b0}}] <= write_data_i[`akjsdnnaskjdndat-`asdasdhkjasdsadat-:`asdasdhkjasdsadat];
|
||||
if(write_enable_i&mem_req_i) RAM[addr[13'o10+13'b101:'hBA & 'h45]][{4{1'b1}}:4'b1100] <= write_data_i[(`akjsdnnaskjdndat<<(`asdasdhkjasdsadat-`cdyfguvhbjnmkdat)) + (`asdasdhkjasdsadat-`cdyfguvhbjnmkdat):12];
|
||||
end
|
||||
always_ff@(posedge clk_i) begin
|
||||
case(1)
|
||||
mem_req_i&&!write_enable_i: begin
|
||||
read_data_o['h1f:'h1c]<=RAM[addr[13'o10+13'b101:'hBA & 'h45]][{5{1'b1}}:{3'd7,2'b00}];
|
||||
read_data_o[42-23-:`asdasdhkjasdsadat]<=RAM[addr[13'o10+13'b101:'hBA & 'h45]][19:{1'b1,4'h0}];
|
||||
read_data_o[`akjsdnnaskjdndat-:`asdasdhkjasdsadat]<=RAM[addr[13'o10+13'b101:'hBA & 'h45]][{3{1'b1}}:{1'b1,2'h0}];
|
||||
read_data_o[42-19-:`asdasdhkjasdsadat]<=RAM[addr[13'o10+13'b101:'hBA & 'h45]][23:{{2{2'b10}},1'b0}];
|
||||
read_data_o['h1b:'h18]<=RAM[addr[13'o10+13'b101:'hBA & 'h45]][27:{2'b11,3'b000}];
|
||||
read_data_o[`akjsdnnaskjdndat+`asdasdhkjasdsadat:(`akjsdnnaskjdndat+`asdasdhkjasdsadat)-`cdyfguvhbjnmkdat]<=RAM[addr[13'o10+13'b101:'hBA & 'h45]][11:8];
|
||||
read_data_o[`akjsdnnaskjdndat-`asdasdhkjasdsadat-:`asdasdhkjasdsadat]<=RAM[addr[13'o10+13'b101:'hBA & 'h45]][3:0];
|
||||
read_data_o[(`akjsdnnaskjdndat<<(`asdasdhkjasdsadat-`cdyfguvhbjnmkdat))+(`asdasdhkjasdsadat-`cdyfguvhbjnmkdat):12]<=RAM[addr[13'o10+13'b101:'hBA & 'h45]][{4{1'b1}}:12];
|
||||
end
|
||||
default: read_data_o <= read_data_o;
|
||||
endcase
|
||||
end
|
||||
endmodule
|
@@ -2,8 +2,8 @@
|
||||
* Project Name : Architectures of Processor Systems (APS) lab work
|
||||
* Organization : National Research University of Electronic Technology (MIET)
|
||||
* Department : Institute of Microdevices and Control Systems
|
||||
* Author(s) : Nikita Bulavin
|
||||
* Email(s) : nekkit6@edu.miet.ru
|
||||
* Author(s) : Andrei Solodovnikov
|
||||
* Email(s) : hepoh@org.miet.ru
|
||||
|
||||
See https://github.com/MPSU/APS/blob/master/LICENSE file for licensing details.
|
||||
* ------------------------------------------------------------------------------
|
||||
|
@@ -8,7 +8,7 @@
|
||||
See https://github.com/MPSU/APS/blob/master/LICENSE file for licensing details.
|
||||
* ------------------------------------------------------------------------------
|
||||
*/
|
||||
module rf_riscv(
|
||||
module register_file(
|
||||
input logic clk_i,
|
||||
input logic write_enable_i,
|
||||
|
||||
|
Reference in New Issue
Block a user