Skip to content

Commit

Permalink
Fix AMO problem in verilator
Browse files Browse the repository at this point in the history
  • Loading branch information
zarubaf committed Mar 18, 2019
1 parent 07df142 commit a4e49fc
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 24 deletions.
4 changes: 4 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# Global Owners
* @zarubaf @msfschaffner

# FPU owners
src/fpu_wrap.sv @stmach
17 changes: 9 additions & 8 deletions fpga/src/ariane_xilinx.sv
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ axi_node_wrap_with_slices #(
// three ports from Ariane (instruction, data and bypass)
.NB_SLAVE ( NBSlave ),
.NB_MASTER ( ariane_soc::NB_PERIPHERALS ),
.NB_REGION ( ariane_soc::NrRegion ),
.AXI_ADDR_WIDTH ( AxiAddrWidth ),
.AXI_DATA_WIDTH ( AxiDataWidth ),
.AXI_USER_WIDTH ( AxiUserWidth ),
Expand Down Expand Up @@ -210,7 +211,7 @@ axi_node_wrap_with_slices #(
ariane_soc::GPIOBase + ariane_soc::GPIOLength - 1,
ariane_soc::DRAMBase + ariane_soc::DRAMLength - 1
}),
.valid_rule_i ('1)
.valid_rule_i (ariane_soc::ValidRule)
);

// ---------------
Expand Down Expand Up @@ -259,7 +260,7 @@ dm_top #(
.NrHarts ( 1 ),
.BusWidth ( AxiDataWidth ),
.Selectable_Harts ( 1'b1 )
) i_dm_top (
) i_dm_top (
.clk_i ( clk ),
.rst_ni ( rst_n ), // PoR
.testmode_i ( test_en ),
Expand Down Expand Up @@ -305,11 +306,11 @@ axi2mem #(
.be_o ( dm_slave_be ),
.data_o ( dm_slave_wdata ),
.data_i ( dm_slave_rdata )
);
);

axi_master_connect i_dm_axi_master_connect (
.axi_req_i(dm_axi_m_req),
.axi_resp_o(dm_axi_m_resp),
.axi_req_i(dm_axi_m_req),
.axi_resp_o(dm_axi_m_resp),
.master(slave[1])
);

Expand All @@ -331,8 +332,8 @@ axi_adapter #(
.valid_o ( dm_master_r_valid ),
.rdata_o ( dm_master_r_rdata ),
.id_o ( ),
.critical_word_o ( ),
.critical_word_valid_o ( ),
.critical_word_o ( ),
.critical_word_valid_o ( ),
.axi_req_o ( dm_axi_m_req ),
.axi_resp_i ( dm_axi_m_resp )
);
Expand Down Expand Up @@ -521,7 +522,7 @@ AXI_BUS #(
.AXI_USER_WIDTH ( AxiUserWidth )
) dram();

axi_riscv_atomics #(
axi_riscv_atomics_wrap #(
.AXI_ADDR_WIDTH ( AxiAddrWidth ),
.AXI_DATA_WIDTH ( AxiDataWidth ),
.AXI_ID_WIDTH ( AxiIdWidthSlaves ),
Expand Down
6 changes: 3 additions & 3 deletions src/fpu_wrap.sv
Original file line number Diff line number Diff line change
Expand Up @@ -362,17 +362,17 @@ generate
fpu_op_d = fpnew_pkg::CPKCD;
fpu_op_mod_d = fpu_rm_i[0]; // C/D selection from R bit
vec_replication = 1'b0; // no replication, R bit used for op
fpu_srcfmt_d = fpnew_pkg::FP64; // Cast from FP64
fpu_srcfmt_d = fpnew_pkg::FP32; // Cast from FP32
end
// Vectorial Convert-and-Pack from FP64, lower 4 entries
VFCPKAB_S : begin
VFCPKAB_D : begin
fpu_op_d = fpnew_pkg::CPKAB;
fpu_op_mod_d = fpu_rm_i[0]; // A/B selection from R bit
vec_replication = 1'b0; // no replication, R bit used for op
fpu_srcfmt_d = fpnew_pkg::FP64; // Cast from FP64
end
// Vectorial Convert-and-Pack from FP64, upper 4 entries
VFCPKCD_S : begin
VFCPKCD_D : begin
fpu_op_d = fpnew_pkg::CPKCD;
fpu_op_mod_d = fpu_rm_i[0]; // C/D selection from R bit
vec_replication = 1'b0; // no replication, R bit used for op
Expand Down
2 changes: 1 addition & 1 deletion src/riscv-dbg
Submodule riscv-dbg updated 0 files
3 changes: 3 additions & 0 deletions tb/ariane_soc_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,7 @@ package ariane_soc;
DRAMBase = 64'h8000_0000
} soc_bus_start_t;

localparam NrRegion = 1;
localparam logic [NrRegion-1:0][NB_PERIPHERALS-1:0] ValidRule = {{NrRegion * NB_PERIPHERALS}{1'b1}};

endpackage
23 changes: 12 additions & 11 deletions tb/ariane_testharness.sv
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,11 @@ module ariane_testharness #(
.be_o ( dm_slave_be ),
.data_o ( dm_slave_wdata ),
.data_i ( dm_slave_rdata )
);
);

axi_master_connect i_dm_axi_master_connect (
.axi_req_i(dm_axi_m_req),
.axi_resp_o(dm_axi_m_resp),
.axi_req_i(dm_axi_m_req),
.axi_resp_o(dm_axi_m_resp),
.master(slave[1])
);

Expand All @@ -271,8 +271,8 @@ module ariane_testharness #(
.valid_o ( dm_master_r_valid ),
.rdata_o ( dm_master_r_rdata ),
.id_o ( ),
.critical_word_o ( ),
.critical_word_valid_o ( ),
.critical_word_o ( ),
.critical_word_valid_o ( ),
.axi_req_o ( dm_axi_m_req ),
.axi_resp_i ( dm_axi_m_resp )
);
Expand Down Expand Up @@ -326,7 +326,7 @@ module ariane_testharness #(
logic [AXI_DATA_WIDTH-1:0] wdata;
logic [AXI_DATA_WIDTH-1:0] rdata;

axi_riscv_atomics #(
axi_riscv_atomics_wrap #(
.AXI_ADDR_WIDTH ( AXI_ADDRESS_WIDTH ),
.AXI_DATA_WIDTH ( AXI_DATA_WIDTH ),
.AXI_ID_WIDTH ( AXI_ID_WIDTH_SLAVES ),
Expand Down Expand Up @@ -377,6 +377,7 @@ module ariane_testharness #(
axi_node_intf_wrap #(
.NB_SLAVE ( NB_SLAVE ),
.NB_MASTER ( ariane_soc::NB_PERIPHERALS ),
.NB_REGION ( ariane_soc::NrRegion ),
.AXI_ADDR_WIDTH ( AXI_ADDRESS_WIDTH ),
.AXI_DATA_WIDTH ( AXI_DATA_WIDTH ),
.AXI_USER_WIDTH ( AXI_USER_WIDTH ),
Expand Down Expand Up @@ -411,7 +412,7 @@ module ariane_testharness #(
ariane_soc::GPIOBase + ariane_soc::GPIOLength - 1,
ariane_soc::DRAMBase + ariane_soc::DRAMLength - 1
}),
.valid_rule_i ('1)
.valid_rule_i (ariane_soc::ValidRule)
);

// ---------------
Expand Down Expand Up @@ -440,8 +441,8 @@ module ariane_testharness #(
);

axi_slave_connect i_axi_slave_connect_clint (
.axi_req_o(axi_clint_req),
.axi_resp_i(axi_clint_resp),
.axi_req_o(axi_clint_req),
.axi_resp_i(axi_clint_resp),
.slave(master[ariane_soc::CLINT])
);

Expand Down Expand Up @@ -515,8 +516,8 @@ module ariane_testharness #(
);

axi_master_connect i_axi_master_connect_ariane (
.axi_req_i(axi_ariane_req),
.axi_resp_o(axi_ariane_resp),
.axi_req_i(axi_ariane_req),
.axi_resp_o(axi_ariane_resp),
.master(slave[0])
);

Expand Down

0 comments on commit a4e49fc

Please sign in to comment.