This commit is contained in:
felsabbagh3 2019-03-31 16:30:37 -04:00
parent 26378d61d8
commit 719ed25213
16 changed files with 1207 additions and 1531 deletions

View file

@ -63,7 +63,7 @@ module VX_alu(
`CSR_ALU_RW: out_alu_result = in_csr_data;
`CSR_ALU_RS: out_alu_result = in_csr_data;
`CSR_ALU_RC: out_alu_result = in_csr_data;
`MUL: begin out_alu_result = mult_signed_result[31:0]; $display("(%x) %x * %x = %x", in_curr_PC, ALU_in1, ALU_in2, out_alu_result); end
`MUL: begin out_alu_result = mult_signed_result[31:0]; end
`MULH: out_alu_result = mult_signed_result[63:32];
`MULHSU: out_alu_result = mult_signed_un_result[63:32];
`MULHU: out_alu_result = mult_unsigned_result[63:32];

View file

@ -26,9 +26,9 @@ module VX_f_d_reg (
integer reset_cur_thread = 0;
always @(in_instruction) begin
$display("in_instruction: %h",in_instruction);
end
// always @(in_instruction) begin
// $display("in_instruction: %h",in_instruction);
// end
always @(posedge clk or posedge reset) begin
if(reset) begin
@ -38,9 +38,9 @@ module VX_f_d_reg (
valid[reset_cur_thread] <= 1'b0;
end else if (in_fwd_stall == 1'b1 || in_freeze == 1'b1 || in_clone_stall) begin
if (in_clone_stall) begin
$display("STALL BECAUSE OF CLONE");
end
// if (in_clone_stall) begin
// $display("STALL BECAUSE OF CLONE");
// end
end else begin
instruction <= in_instruction;
valid <= in_valid;

View file

@ -36,11 +36,11 @@ module VX_memory (
output wire[31:0] out_cache_driver_in_data[`NT_M1:0]
);
always @(in_mem_read, in_cache_driver_out_data) begin
if (in_mem_read == `LW_MEM_READ) begin
$display("PC: %h ----> Received: %h for addr: ", in_curr_PC, in_cache_driver_out_data[0], in_alu_result[0]);
end
end
// always @(in_mem_read, in_cache_driver_out_data) begin
// if (in_mem_read == `LW_MEM_READ) begin
// $display("PC: %h ----> Received: %h for addr: ", in_curr_PC, in_cache_driver_out_data[0], in_alu_result[0]);
// end
// end
assign out_delay = 1'b0;
@ -59,14 +59,14 @@ module VX_memory (
assign out_PC_next = in_PC_next;
assign out_valid = in_valid;
always @(*) begin
// always @(*) begin
if (in_cache_driver_out_data[0] != 32'hbabebabe)
begin
$display("MEM: data read from cache_driver: %h", in_cache_driver_out_data[0]);
end
// if (in_cache_driver_out_data[0] != 32'hbabebabe)
// begin
// $display("MEM: data read from cache_driver: %h", in_cache_driver_out_data[0]);
// end
end
// end
assign out_branch_dest = $signed(in_curr_PC) + ($signed(in_branch_offset) << 1);

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -8,7 +8,7 @@
#ifndef _VVortex_H_
#define _VVortex_H_
#include "verilated_heavy.h"
#include "verilated.h"
class VVortex__Syms;
@ -200,9 +200,6 @@ VL_MODULE(VVortex) {
struct {
// Begin mtask footprint all:
VL_SIG8(__Vtableidx1,2,0);
VL_SIG8(__Vdlyvset__Vortex__DOT__vx_f_d_reg__DOT__valid__v0,0,0);
VL_SIG8(__Vdlyvset__Vortex__DOT__vx_f_d_reg__DOT__valid__v8,0,0);
VL_SIG8(__Vdlyvset__Vortex__DOT__vx_f_d_reg__DOT__valid__v9,0,0);
VL_SIG8(__Vclklast__TOP__clk,0,0);
VL_SIG8(__Vclklast__TOP__reset,0,0);
VL_SIG(Vortex__DOT__vx_decode__DOT____Vcellout__vx_register_file_master__out_src2_data,31,0);
@ -263,11 +260,11 @@ VL_MODULE(VVortex) {
VL_SIG8(Vortex__DOT____Vcellout__vx_memory__out_cache_driver_in_valid[8],0,0);
VL_SIG(Vortex__DOT____Vcellout__vx_memory__out_cache_driver_in_data[8],31,0);
VL_SIG(Vortex__DOT____Vcellout__vx_memory__out_cache_driver_in_address[8],31,0);
};
struct {
VL_SIG8(Vortex__DOT____Vcellout__vx_memory__out_valid[8],0,0);
VL_SIG(Vortex__DOT____Vcellout__vx_memory__out_mem_result[8],31,0);
VL_SIG(Vortex__DOT____Vcellout__vx_memory__out_alu_result[8],31,0);
};
struct {
VL_SIG(Vortex__DOT____Vcellinp__vx_memory__in_cache_driver_out_data[8],31,0);
VL_SIG8(Vortex__DOT____Vcellinp__vx_memory__in_valid[8],0,0);
VL_SIG(Vortex__DOT____Vcellinp__vx_memory__in_rd2[8],31,0);

Binary file not shown.

View file

@ -1,5 +1,4 @@
VVortex__ALLcls.o: VVortex__ALLcls.cpp VVortex.cpp VVortex.h \
/usr/local/Cellar/verilator/4.010/share/verilator/include/verilated_heavy.h \
/usr/local/Cellar/verilator/4.010/share/verilator/include/verilated.h \
/usr/local/Cellar/verilator/4.010/share/verilator/include/verilatedos.h \
VVortex__Syms.h

Binary file not shown.

View file

@ -1,5 +1,4 @@
VVortex__ALLsup.o: VVortex__ALLsup.cpp VVortex__Syms.cpp VVortex__Syms.h \
/usr/local/Cellar/verilator/4.010/share/verilator/include/verilated_heavy.h \
/usr/local/Cellar/verilator/4.010/share/verilator/include/verilated.h \
/usr/local/Cellar/verilator/4.010/share/verilator/include/verilatedos.h \
VVortex.h

View file

@ -6,7 +6,7 @@
#ifndef _VVortex__Syms_H_
#define _VVortex__Syms_H_
#include "verilated_heavy.h"
#include "verilated.h"
// INCLUDE MODULE CLASSES
#include "VVortex.h"

View file

@ -1,27 +1,27 @@
# DESCRIPTION: Verilator output: Timestamp data for --skip-identical. Delete at will.
C "-Wall -cc Vortex.v --exe test_bench.cpp"
S 4608404 12889046060 1553037052 0 1548678579 0 "/usr/local/Cellar/verilator/4.010/bin/verilator_bin"
S 2862 12889457986 1554023089 0 1554023089 0 "VX_alu.v"
S 2785 12889457986 1554064009 0 1554064009 0 "VX_alu.v"
S 1495 12889457987 1554023089 0 1554023089 0 "VX_csr_handler.v"
S 5105 12889457988 1554023089 0 1554023089 0 "VX_d_e_reg.v"
S 15102 12889457989 1554023916 0 1554023916 0 "VX_decode.v"
S 1557 12889457991 1554023528 0 1554023528 0 "VX_define.v"
S 4077 12889457992 1554023089 0 1554023089 0 "VX_e_m_reg.v"
S 3288 12889457993 1554023938 0 1554023938 0 "VX_execute.v"
S 1540 12889457994 1554023089 0 1554023089 0 "VX_f_d_reg.v"
S 1558 12889457994 1554064040 0 1554064040 0 "VX_f_d_reg.v"
S 4606 12889457995 1554023897 0 1554023897 0 "VX_fetch.v"
S 5632 12889457996 1554023089 0 1554023089 0 "VX_forwarding.v"
S 1677 12889457997 1554023089 0 1554023089 0 "VX_m_w_reg.v"
S 3002 12889457998 1554023089 0 1554023089 0 "VX_memory.v"
S 3035 12889457998 1554064111 0 1554064111 0 "VX_memory.v"
S 1078 12889457999 1554023928 0 1554023928 0 "VX_register_file.v"
S 1387 12889458000 1554023933 0 1554023933 0 "VX_register_file_slave.v"
S 1323 12889458001 1554023982 0 1554023982 0 "VX_writeback.v"
S 16910 12889458002 1554023089 0 1554023089 0 "Vortex.v"
T 797432 12889458029 1554023984 0 1554023984 0 "obj_dir/VVortex.cpp"
T 21112 12889458030 1554023984 0 1554023984 0 "obj_dir/VVortex.h"
T 1800 12889458031 1554023984 0 1554023984 0 "obj_dir/VVortex.mk"
T 530 12889458039 1554023984 0 1554023984 0 "obj_dir/VVortex__Syms.cpp"
T 717 12889458040 1554023984 0 1554023984 0 "obj_dir/VVortex__Syms.h"
T 489 12889458041 1554023984 0 1554023984 0 "obj_dir/VVortex__ver.d"
T 0 0 1554023984 0 1554023984 0 "obj_dir/VVortex__verFiles.dat"
T 1159 12889458043 1554023984 0 1554023984 0 "obj_dir/VVortex_classes.mk"
T 778984 12889458029 1554064114 0 1554064114 0 "obj_dir/VVortex.cpp"
T 20905 12889458030 1554064114 0 1554064114 0 "obj_dir/VVortex.h"
T 1800 12889458031 1554064114 0 1554064114 0 "obj_dir/VVortex.mk"
T 530 12889458039 1554064114 0 1554064114 0 "obj_dir/VVortex__Syms.cpp"
T 711 12889458040 1554064114 0 1554064114 0 "obj_dir/VVortex__Syms.h"
T 489 12889458041 1554064114 0 1554064114 0 "obj_dir/VVortex__ver.d"
T 0 0 1554064114 0 1554064114 0 "obj_dir/VVortex__verFiles.dat"
T 1159 12889458043 1554064114 0 1554064114 0 "obj_dir/VVortex_classes.mk"

View file

@ -1,5 +1,4 @@
test_bench.o: ../test_bench.cpp ../test_bench.h ../VX_define.h ../ram.h \
VVortex.h \
/usr/local/Cellar/verilator/4.010/share/verilator/include/verilated_heavy.h \
/usr/local/Cellar/verilator/4.010/share/verilator/include/verilated.h \
/usr/local/Cellar/verilator/4.010/share/verilator/include/verilatedos.h

Binary file not shown.

View file

@ -1,5 +1,3 @@
**************** ../../kernel/vortex_test.hex ****************
# Dynamic Instructions: 365972
# of total cycles: 365984
# of forwarding stalls: 0

View file

@ -142,8 +142,8 @@ bool Vortex::ibus_driver()
ram.getWord(new_PC, &curr_inst);
vortex->fe_instruction = curr_inst;
printf("\n\n---------------------------------------------\n(%x) Inst: %x\n", new_PC, curr_inst);
printf("\n");
// printf("\n\n---------------------------------------------\n(%x) Inst: %x\n", new_PC, curr_inst);
// printf("\n");
////////////////////// IBUS //////////////////////
@ -157,7 +157,7 @@ bool Vortex::ibus_driver()
stop = false;
} else
{
printf("Ibus requesting stop: %x\n", curr_inst);
// printf("Ibus requesting stop: %x\n", curr_inst);
stop = true;
}
@ -208,7 +208,7 @@ bool Vortex::dbus_driver()
}
printf("----\n");
// printf("----\n");
for (unsigned curr_th = 0; curr_th < NT; curr_th++)
{
@ -258,7 +258,7 @@ bool Vortex::dbus_driver()
}
}
printf("******\n");
// printf("******\n");
return false;
@ -270,7 +270,7 @@ bool Vortex::simulate(std::string file_to_simulate)
{
this->instruction_file_name = file_to_simulate;
this->results << "\n****************\t" << file_to_simulate << "\t****************\n";
// this->results << "\n****************\t" << file_to_simulate << "\t****************\n";
this->ProcessFile();
@ -328,6 +328,8 @@ bool Vortex::simulate(std::string file_to_simulate)
bool dstop;
// for (int i = 0; i < 500; i++)
// unsigned cycles;
while (this->stop && (!(stop && (counter > 5))))
{
@ -358,6 +360,7 @@ bool Vortex::simulate(std::string file_to_simulate)
cycle++;
}
std::cerr << "Total Cycles: " << cycle << "\n";
uint32_t status;
ram.getWord(0, &status);