URL
https://opencores.org/ocsvn/openhmc/openhmc/trunk
Subversion Repositories openhmc
Compare Revisions
- This comparison shows the changes necessary to convert path
/openhmc/trunk/openHMC/sim/tb
- from Rev 12 to Rev 15
- ↔ Reverse comparison
Rev 12 → Rev 15
/bfm/build/compile_tb_openhmc.f
File deleted
/bfm/build/compile_hw_openhmc.f
File deleted
\ No newline at end of file
/bfm/build/compile_ius_openhmc_behavioral_bfm.f
38,10 → 38,16
|
###Include Sources |
#Behavioral serializer and routing models |
-f ${OPENHMC_SIM}/tb/bfm/src/serdes/behavioral/serdes_behavioral.f |
-f ${OPENHMC_SIM}/tb/common/src/serdes/behavioral/serdes_behavioral.f |
|
#Source top TB, HW, and DUT |
-f ${OPENHMC_SIM}/tb/bfm/build/compile_tb_openhmc.f |
-f ${OPENHMC_SIM}/tb/bfm/build/compile_hw_openhmc.f |
#Micron BFM model |
-f ${OPENHMC_SIM}/bfm/hmc_bfm.f |
+incdir+${OPENHMC_SIM}/bfm |
-f ${OPENHMC_SIM}/tb/common/build/compile_tb_openhmc.f |
-f ${OPENHMC_SIM}/tb/common/build/compile_hw_openhmc.f |
+incdir+${OPENHMC_SIM}/tb/bfm/testlib |
+incdir+${OPENHMC_SIM}/tb/bfm/src |
${OPENHMC_SIM}/tb/bfm/src/tb_top_bfm.sv |
${OPENHMC_SIM}/tb/bfm/src/targets/dut_openhmc_behavioral_bfm.sv |
|
/bfm/build/ncsim.tcl
4,8 → 4,18
probe -create tb_top.dut_I.openhmc_instance.rx_link_I -all -database waves -memories |
probe -create tb_top.dut_I.openhmc_instance.tx_link_I -all -database waves -memories |
|
probe -create tb_top.axi4_hmc_rsp_if -all -database waves |
probe -create tb_top.axi4_hmc_req_if -all -database waves |
probe -create tb_top.hmc_if -all -database waves |
|
set assert_output_stop_level failed |
set assert_report_incompletes 0 |
|
#-- enable IDA probes |
#ida_database -open -name=ida.db -compress |
#ida_probe -log=on |
#ida_probe -wave=on |
#ida_probe -sv_flow=on |
|
run |
|
/bfm/testlib/seq_lib/hmc_small_pkts_zdelay_seq.sv
File deleted
\ No newline at end of file
/bfm/testlib/seq_lib/hmc_big_pkts_seq.sv
File deleted
/bfm/testlib/seq_lib/hmc_complex_pkt_seq.sv
File deleted
\ No newline at end of file
/bfm/testlib/seq_lib/hmc_hdelay_seq.sv
File deleted
\ No newline at end of file
/bfm/testlib/seq_lib/hmc_seq_lib.sv
File deleted
\ No newline at end of file
/bfm/testlib/seq_lib/hmc_base_pkt_seq.sv
File deleted
\ No newline at end of file
/bfm/testlib/seq_lib/hmc_big_pkts_hdelay_seq.sv
File deleted
\ No newline at end of file
/bfm/testlib/seq_lib/hmc_zdelay_seq.sv
File deleted
\ No newline at end of file
/bfm/testlib/seq_lib/hmc_small_pkts_seq.sv
File deleted
\ No newline at end of file
/bfm/testlib/seq_lib/hmc_big_pkts_zdelay_seq.sv
File deleted
/bfm/testlib/seq_lib/hmc_single_pkt_cycle_seq.sv
File deleted
\ No newline at end of file
/bfm/testlib/seq_lib/hmc_small_pkts_hdelay_seq.sv
File deleted
\ No newline at end of file
/bfm/testlib/init_test/init_test_seq.sv
File deleted
/bfm/testlib/init_test/init_test.sv
File deleted
\ No newline at end of file
/bfm/testlib/high_delay_pkt_test/high_delay_pkt_test_seq.sv
File deleted
\ No newline at end of file
/bfm/testlib/high_delay_pkt_test/high_delay_pkt_test.sv
File deleted
\ No newline at end of file
/bfm/testlib/posted_pkt_test/posted_pkt_test_seq.sv
File deleted
\ No newline at end of file
/bfm/testlib/posted_pkt_test/posted_pkt_test.sv
File deleted
\ No newline at end of file
/bfm/testlib/big_pkt_zdelay_test/big_pkt_zdelay_test_seq.sv
File deleted
\ No newline at end of file
/bfm/testlib/big_pkt_zdelay_test/big_pkt_zdelay_test.sv
File deleted
\ No newline at end of file
/bfm/testlib/non_posted_pkt_test/non_posted_pkt_test.sv
File deleted
\ No newline at end of file
/bfm/testlib/non_posted_pkt_test/non_posted_pkt_test_seq.sv
File deleted
\ No newline at end of file
/bfm/testlib/small_pkt_hdelay_test/small_pkt_hdelay_test.sv
File deleted
\ No newline at end of file
/bfm/testlib/small_pkt_hdelay_test/small_pkt_hdelay_test_seq.sv
File deleted
\ No newline at end of file
/bfm/testlib/big_pkt_test/big_pkt_test_seq.sv
File deleted
\ No newline at end of file
/bfm/testlib/big_pkt_test/big_pkt_test.sv
File deleted
\ No newline at end of file
/bfm/testlib/simple_test/simple_test_seq.sv
File deleted
/bfm/testlib/simple_test/simple_test.sv
File deleted
\ No newline at end of file
/bfm/testlib/small_pkt_zdelay_test/small_pkt_zdelay_test_seq.sv
File deleted
\ No newline at end of file
/bfm/testlib/small_pkt_zdelay_test/small_pkt_zdelay_test.sv
File deleted
\ No newline at end of file
/bfm/testlib/sleep_mode/sleep_mode_seq.sv
File deleted
/bfm/testlib/sleep_mode/sleep_mode.sv
File deleted
\ No newline at end of file
/bfm/testlib/big_pkt_hdelay_test/big_pkt_hdelay_test_seq.sv
File deleted
\ No newline at end of file
/bfm/testlib/big_pkt_hdelay_test/big_pkt_hdelay_test.sv
File deleted
\ No newline at end of file
/bfm/testlib/atomic_pkt_test/atomic_pkt_test_seq.sv
File deleted
\ No newline at end of file
/bfm/testlib/atomic_pkt_test/atomic_pkt_test.sv
File deleted
\ No newline at end of file
/bfm/testlib/test_lib.sv
File deleted
/bfm/testlib/zero_delay_pkt_test/zero_delay_pkt_test_seq.sv
File deleted
\ No newline at end of file
/bfm/testlib/zero_delay_pkt_test/zero_delay_pkt_test.sv
File deleted
\ No newline at end of file
/bfm/testlib/hmc_check_seq.sv
File deleted
/bfm/testlib/small_pkt_test/small_pkt_test_seq.sv
File deleted
\ No newline at end of file
/bfm/testlib/small_pkt_test/small_pkt_test.sv
File deleted
\ No newline at end of file
/bfm/testlib/bfm_init_seq.sv
File deleted
/bfm/testlib/hmc_init_seq.sv
File deleted
/bfm/testlib/hmc_base_test.sv
62,7 → 62,8
//-- AXI4 request config |
axi4_req_config = axi4_stream_config::type_id::create("axi4_req_config", this); |
axi4_req_config.master_active = UVM_ACTIVE; |
axi4_req_config.slave_active = UVM_PASSIVE; |
axi4_req_config.slave_active = UVM_PASSIVE; |
axi4_req_config.open_rsp_mode = UVM_PASSIVE; |
|
uvm_report_info(get_type_name(), $psprintf("Setting the axi4_req config:\n"), UVM_LOW); |
uvm_config_db#(axi4_stream_config)::set(this, "hmc_tb0", "axi4_req_config", axi4_req_config); |
71,6 → 72,7
axi4_rsp_config = axi4_stream_config::type_id::create("axi4_rsp_config", this); |
axi4_rsp_config.master_active = UVM_PASSIVE; |
axi4_rsp_config.slave_active = UVM_ACTIVE; |
axi4_rsp_config.open_rsp_mode = `OPEN_RSP_MODE==1 ? UVM_ACTIVE : UVM_PASSIVE; |
|
uvm_report_info(get_type_name(), $psprintf("Setting the axi4_rsp config:\n"), UVM_LOW); |
uvm_config_db#(axi4_stream_config)::set(this, "hmc_tb0", "axi4_rsp_config", axi4_rsp_config); |
77,6 → 79,7
|
//-- HMC link config |
link_cfg = hmc_link_config::type_id::create("link_cfg",this); |
link_cfg.cfg_rsp_open_loop = `OPEN_RSP_MODE==1 ? UVM_ACTIVE : UVM_PASSIVE; |
void'(link_cfg.randomize()); |
|
uvm_config_db#(hmc_link_config)::set(this, "hmc_tb0", "link_cfg", link_cfg); |
104,10 → 107,6
phase.phase_done.set_drain_time(this, 10us); |
endtask : run_phase |
|
//function void report_phase(uvm_phase phase); |
// report_summarize(); |
//endfunction : report_phase |
|
endclass : hmc_base_test |
|
|
118,7 → 117,7
endfunction : new |
|
`uvm_object_utils(hmc_base_seq) |
`uvm_declare_p_sequencer(hmc_vseqr) |
`uvm_declare_p_sequencer(vseqr) |
|
virtual task pre_body(); |
if(starting_phase != null) |
/bfm/testlib/hmc_model_init_seq.sv
0,0 → 1,135
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
`ifndef BFM_INIT_SEQ |
`define BFM_INIT_SEQ |
|
class hmc_model_init_seq extends hmc_base_seq; |
|
reg_openhmc_rf_status_general_c status; |
reg_openhmc_rf_control_c control; |
reg_openhmc_rf_sent_np_c sent_np; |
reg_openhmc_rf_rcvd_rsp_c rcvd_rsp; |
|
function new(string name="hmc_model_init_seq"); |
super.new(name); |
endfunction : new |
|
`uvm_object_utils(hmc_model_init_seq) |
`uvm_declare_p_sequencer(vseqr) |
|
task body(); |
|
// init register |
//initiate all the registers (used for sleep mode) |
$cast(status,p_sequencer.rf_seqr_hmc.get_by_name("status_general")); |
status.set_check_on_read(1'b0); |
|
$cast(control,p_sequencer.rf_seqr_hmc.get_by_name("control")); |
control.set_check_on_read(1'b0); |
|
$cast(sent_np,p_sequencer.rf_seqr_hmc.get_by_name("sent_np")); |
sent_np.set_check_on_read(1'b0); |
|
$cast(rcvd_rsp,p_sequencer.rf_seqr_hmc.get_by_name("rcvd_rsp")); |
rcvd_rsp.set_check_on_read(1'b0); |
|
|
`uvm_info(get_type_name(), $psprintf("Configure BFM"), UVM_NONE) |
`uvm_info(get_type_name(), $psprintf("HMC_Token Count is: %d", p_sequencer.link_cfg.hmc_tokens), UVM_NONE) |
p_sequencer.hmc_link_cfg.cfg_cid = p_sequencer.link_cfg.cube_id; |
p_sequencer.hmc_link_cfg.cfg_lane_auto_correct = p_sequencer.link_cfg.cfg_lane_auto_correct; |
p_sequencer.hmc_link_cfg.cfg_rsp_open_loop = p_sequencer.link_cfg.cfg_rsp_open_loop; |
|
// These are set to match the design |
p_sequencer.hmc_link_cfg.cfg_rx_clk_ratio = p_sequencer.link_cfg.cfg_rx_clk_ratio; |
p_sequencer.hmc_link_cfg.cfg_half_link_mode_rx = p_sequencer.link_cfg.cfg_half_link_mode_rx; |
p_sequencer.hmc_link_cfg.cfg_tx_lane_reverse = p_sequencer.link_cfg.cfg_tx_lane_reverse; |
p_sequencer.hmc_link_cfg.cfg_tx_lane_delay = p_sequencer.link_cfg.cfg_tx_lane_delay; |
|
p_sequencer.hmc_link_cfg.cfg_hsstx_inv = p_sequencer.link_cfg.cfg_hsstx_inv; |
|
|
p_sequencer.hmc_link_cfg.cfg_tx_clk_ratio = p_sequencer.link_cfg.cfg_tx_clk_ratio; |
p_sequencer.hmc_link_cfg.cfg_half_link_mode_tx = p_sequencer.link_cfg.cfg_half_link_mode_tx; |
|
p_sequencer.hmc_link_cfg.cfg_descram_enb = p_sequencer.link_cfg.cfg_scram_enb; |
p_sequencer.hmc_link_cfg.cfg_scram_enb = p_sequencer.link_cfg.cfg_scram_enb; |
p_sequencer.hmc_link_cfg.cfg_tokens = p_sequencer.link_cfg.hmc_tokens; |
p_sequencer.hmc_link_cfg.cfg_tokens_expected = p_sequencer.link_cfg.rx_tokens; |
|
p_sequencer.hmc_link_cfg.cfg_init_retry_rxcnt = p_sequencer.link_cfg.cfg_init_retry_rxcnt; |
p_sequencer.hmc_link_cfg.cfg_init_retry_txcnt = p_sequencer.link_cfg.cfg_init_retry_txcnt; |
|
//***Enable Errors - Dont touch |
p_sequencer.hmc_link_cfg.cfg_rsp_dln = p_sequencer.link_cfg.cfg_rsp_dln; |
p_sequencer.hmc_link_cfg.cfg_rsp_lng = p_sequencer.link_cfg.cfg_rsp_lng; |
p_sequencer.hmc_link_cfg.cfg_rsp_crc = p_sequencer.link_cfg.cfg_rsp_crc; |
p_sequencer.hmc_link_cfg.cfg_rsp_seq = p_sequencer.link_cfg.cfg_rsp_seq; |
p_sequencer.hmc_link_cfg.cfg_rsp_poison = p_sequencer.link_cfg.cfg_rsp_poison; |
|
p_sequencer.hmc_link_cfg.cfg_req_dln = p_sequencer.link_cfg.cfg_req_dln; |
p_sequencer.hmc_link_cfg.cfg_req_lng = p_sequencer.link_cfg.cfg_req_lng; |
p_sequencer.hmc_link_cfg.cfg_req_crc = p_sequencer.link_cfg.cfg_req_crc; |
p_sequencer.hmc_link_cfg.cfg_req_seq = p_sequencer.link_cfg.cfg_req_seq; |
|
//Reduce timings for simulation |
p_sequencer.hmc_link_cfg.cfg_tsref = p_sequencer.link_cfg.cfg_tsref; |
p_sequencer.hmc_link_cfg.cfg_top = p_sequencer.link_cfg.cfg_top; |
|
p_sequencer.hmc_link_cfg.cfg_retry_timeout = p_sequencer.link_cfg.cfg_retry_timeout; |
p_sequencer.hmc_link_cfg.cfg_retry_limit = p_sequencer.link_cfg.cfg_retry_limit; //8 |
|
//Enable retry |
p_sequencer.hmc_link_cfg.cfg_retry_enb = p_sequencer.link_cfg.cfg_retry_enb; |
|
if(p_sequencer.hmc_link_cfg.cfg_scram_enb) |
p_sequencer.hmc_link_cfg.cfg_tx_rl_lim = p_sequencer.link_cfg.cfg_tx_rl_lim; |
|
p_sequencer.hmc_link_cfg.display(); //uncomment for full link configuration output |
|
tb_top.dut_I.hmc_bfm0.set_config(p_sequencer.hmc_link_cfg,0); |
`uvm_info(get_type_name(), $psprintf("HMC BFM CONFIGURATION IS COMPLETE"), UVM_NONE) |
|
|
endtask : body |
|
endclass : hmc_model_init_seq |
|
`endif // HMC_INIT_SEQ |
/bfm/testlib/openhmc_init_seq.sv
0,0 → 1,140
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
`ifndef HMC_INIT_SEQ |
`define HMC_INIT_SEQ |
|
class openhmc_init_seq extends hmc_base_seq; |
|
function new(string name="openhmc_init_seq"); |
super.new(name); |
endfunction : new |
|
`uvm_object_utils(openhmc_init_seq) |
`uvm_declare_p_sequencer(vseqr) |
|
bit phy_tx_ready = 1'b0; |
bit phy_rx_ready = 1'b0; |
bit link_up = 1'b0; |
int timeout = 0; |
|
task body(); |
|
//------------------------------------------------------- configure the openHMC controller |
reg_openhmc_rf_control_c control; |
reg_openhmc_rf_status_general_c status; |
reg_openhmc_rf_status_init_c status_init; |
reg_openhmc_rf_counter_reset_c cnt_reset; |
|
`uvm_info(get_type_name(), "Running init sequence", UVM_NONE) |
|
$cast(control,p_sequencer.rf_seqr_hmc.get_by_name("control")); |
control.set_check_on_read(1'b0); |
p_sequencer.rf_seqr_hmc.read_reg(control); |
|
control.fields.rx_token_count_ = p_sequencer.link_cfg.rx_tokens; |
control.fields.scrambler_disable_ = ~p_sequencer.link_cfg.cfg_scram_enb; |
control.fields.bit_slip_time_ = p_sequencer.link_cfg.bit_slip_time; |
control.fields.set_hmc_sleep_ = 0; |
control.fields.run_length_enable_ = ~p_sequencer.link_cfg.cfg_scram_enb; |
control.fields.irtry_to_send_ = p_sequencer.link_cfg.cfg_init_retry_txcnt*4; |
control.fields.irtry_received_threshold_ = p_sequencer.link_cfg.cfg_init_retry_rxcnt; |
|
p_sequencer.rf_seqr_hmc.write_reg(control); |
|
//Dummy Read to status init |
$cast(status_init,p_sequencer.rf_seqr_hmc.get_by_name("status_init")); |
status_init.set_check_on_read(1'b0); |
p_sequencer.rf_seqr_hmc.read_reg(status_init); |
|
//Dummy counter reset |
$cast(cnt_reset,p_sequencer.rf_seqr_hmc.get_by_name("counter_reset")); |
cnt_reset.fields.rreinit_ = 1; |
p_sequencer.rf_seqr_hmc.write_reg(cnt_reset); |
|
//-- Wait until the PHY is out of reset |
$cast(status,p_sequencer.rf_seqr_hmc.get_by_name("status_general")); |
status.set_check_on_read(1'b0); |
while (phy_tx_ready == 1'b0) |
begin |
#1us; |
p_sequencer.rf_seqr_hmc.read_reg(status); |
phy_tx_ready = status.fields.phy_tx_ready_; |
`uvm_info(get_type_name(), "Waiting for the PHY TX to get ready", UVM_NONE) |
end |
`uvm_info(get_type_name(), "Phy TX ready", UVM_NONE) |
|
//------------------------------------------------------- Set Reset and Init Continue |
control.fields.p_rst_n_ = 1; |
p_sequencer.rf_seqr_hmc.write_reg(control); |
#1us; |
|
control.fields.hmc_init_cont_set_ = 1; |
p_sequencer.rf_seqr_hmc.write_reg(control); |
`uvm_info(get_type_name(), "Init cont in RF set", UVM_NONE) |
|
//------------------------------------------------------- Wait for the PHY to get ready |
while (phy_rx_ready == 1'b0) |
begin |
#1us; |
p_sequencer.rf_seqr_hmc.read_reg(status); |
phy_rx_ready = status.fields.phy_rx_ready_; |
`uvm_info(get_type_name(), "Waiting for PHY RX to get ready", UVM_NONE) |
end |
`uvm_info(get_type_name(), "Phy RX is ready", UVM_NONE) |
|
//-- Poll on link_up to make sure that it comes up. |
while (link_up == 1'b0) |
begin |
if (timeout == 8000) //-- Try Resetting it. |
begin |
`uvm_fatal(get_type_name(), "The link didn't come up...") |
end |
#4ns; |
p_sequencer.rf_seqr_hmc.read_reg(status); |
link_up = status.fields.link_up_; |
timeout = timeout + 1; |
end |
`uvm_info(get_type_name(), "Link is UP !", UVM_NONE) |
|
endtask : body |
|
endclass : openhmc_init_seq |
|
`endif // HMC_INIT_SEQ |
/bfm/src/serdes/behavioral/serializer.v
File deleted
/bfm/src/serdes/behavioral/serdes_behavioral.f
File deleted
/bfm/src/serdes/behavioral/deserializer.v
File deleted
/bfm/src/tag_handler.sv
File deleted
/bfm/src/hmc_req_packet.sv
File deleted
/bfm/src/rgm/openhmc/register_file_model_16x.sv
File deleted
/bfm/src/rgm/openhmc/register_file_model_8x.sv
File deleted
/bfm/src/hmc_2_axi4_sequencer.sv
File deleted
/bfm/src/bfm_2_hmc_monitor.sv
File deleted
/bfm/src/hmc_2_axi4_sequence.sv
File deleted
/bfm/src/hmc_vseqr.sv
File deleted
/bfm/src/hmc_link_config.sv
48,12 → 48,13
|
rand int hmc_tokens; |
rand int rx_tokens; |
rand bit [5:0] bit_slip_time; |
rand bit [2:0] cube_id; |
|
rand bit cfg_tx_lane_reverse; |
rand bit [15:0] cfg_hsstx_inv; |
rand bit cfg_scram_enb; |
rand bit [15:0] cfg_tx_lane_delay[16] = '{16{4'h0}}; |
bit cfg_scram_enb = 1; |
rand bit [15:0] cfg_tx_lane_delay[16]; |
rand bit [ 3:0] cfg_retry_limit = 3; //-- LINKRETRY - infinite retry when cfg_retry_limit[3] == 1 |
rand bit [ 2:0] cfg_retry_timeout = 5; |
|
60,14 → 61,19
rand bit cfg_check_pkt = 1; //-- check for valid packet |
|
bit cfg_lane_auto_correct = 1; |
bit cfg_rsp_open_loop = 0; |
int cfg_rx_clk_ratio = 40; |
bit cfg_half_link_mode_rx = (2**`LOG_NUM_LANES==8); |
uvm_active_passive_enum cfg_rsp_open_loop = UVM_PASSIVE; |
bit cfg_half_link_mode_rx = (`LOG_NUM_LANES==3); |
bit [7:0] cfg_tx_rl_lim = 85; |
int cfg_tx_clk_ratio = 40; |
bit cfg_half_link_mode_tx = (2**`LOG_NUM_LANES==8); |
bit [7:0] cfg_init_retry_rxcnt = 16; |
bit [7:0] cfg_init_retry_txcnt = 6; //-- Actual value in BFM is 4times this value |
`ifdef HMC_12G |
int cfg_rx_clk_ratio = 50; //Set to 50 for 12.5Gbit , 60 for 15Gbit |
int cfg_tx_clk_ratio = 50; //Set to 50 for 12.5Gbit , 60 for 15Gbit |
`else |
int cfg_rx_clk_ratio = 40; //Set to 50 for 12.5Gbit , 60 for 15Gbit |
int cfg_tx_clk_ratio = 40; //Set to 50 for 12.5Gbit , 60 for 15Gbit |
`endif |
bit cfg_half_link_mode_tx = (`LOG_NUM_LANES==3); |
rand bit [7:0] cfg_init_retry_rxcnt; |
rand bit [7:0] cfg_init_retry_txcnt; //-- Actual value in BFM is 4times this value |
realtime cfg_tsref = 1us; |
realtime cfg_top = 1us; |
|
82,9 → 88,26
//-- constrains |
//-- |
|
constraint cfg_init_retry_rxcnt_c { |
cfg_init_retry_rxcnt == 16; |
// cfg_init_retry_rxcnt <= 20; |
} |
|
constraint cfg_init_retry_txcnt_c { |
//Actual Value is constraint*4 |
// cfg_init_retry_txcnt >= 5; |
cfg_init_retry_txcnt == 7; |
} |
|
constraint bit_slip_time_c { |
bit_slip_time >= 32; |
bit_slip_time <= 63; |
} |
|
constraint hmc_tokens_c { |
hmc_tokens >= 25; |
soft hmc_tokens dist{[25:30]:/5, [31:100]:/15, [101:1023]:/80}; |
// soft hmc_tokens dist{[25:30]:/5, [31:100]:/15, [101:1023]:/80}; |
soft hmc_tokens dist{[25:30]:/5, [31:219]:/95}; //Current hardware |
} |
|
constraint cfg_hsstx_inv_c { |
93,7 → 116,8
|
constraint rx_tokens_c { |
rx_tokens >= 9; |
soft rx_tokens dist{[9:30]:/5, [31:100]:/15, [101:1023]:/80}; |
// soft rx_tokens dist{[9:30]:/5, [31:100]:/15, [101:1023]:/80}; //Make sure to increase the input buffer accordingly |
soft rx_tokens dist{[9:30]:/5, [31:255]:/95}; //Safe value for input buffer address size = 8. Leave some FLITs for poisoned packets |
} |
|
constraint cube_id_c { |
113,18 → 137,16
|
|
constraint error_rates_c { |
soft cfg_rsp_dln == 5; |
soft cfg_rsp_lng == 5; |
soft cfg_rsp_crc == 5; |
soft cfg_rsp_seq == 5; |
soft cfg_rsp_poison == 5; |
soft cfg_rsp_dln ==0;//dist{[0:10]}; |
soft cfg_rsp_lng ==0;//dist{[0:10]}; |
soft cfg_rsp_crc ==0;//dist{[0:10]}; |
soft cfg_rsp_seq ==0;//dist{[0:10]}; |
soft cfg_rsp_poison ==0;//dist{[0:10]}; |
soft cfg_req_dln ==0;//dist{[0:10]}; |
soft cfg_req_lng ==0;//dist{[0:10]}; |
soft cfg_req_crc ==0;//dist{[0:10]}; |
soft cfg_req_seq ==0; // Must be zero for BFM 28965 ! |
|
soft cfg_req_dln == 5; |
soft cfg_req_lng == 5; |
soft cfg_req_crc == 5; |
soft cfg_req_seq == 0; // Must be zero for BFM 28965 ! |
|
|
( |
cfg_rsp_dln || |
cfg_rsp_lng || |
161,4 → 183,4
|
endclass : hmc_link_config |
|
`endif // AXI4_STREAM_CONFIG_SV |
`endif // HMC_LINK_CONFIG_SV |
/bfm/src/tb_top_bfm.sv
62,13 → 62,12
|
`include "hmc_packet.sv" |
`include "hmc_req_packet.sv" |
//`include "hmc_req_posted_packet.sv" |
`include "hmc_2_axi4_sequencer.sv" |
`include "hmc_2_axi4_sequence.sv" |
`include "tag_handler.sv" |
|
`include "hmc_link_config.sv" |
`include "hmc_vseqr.sv" |
`include "vseqr.sv" |
|
`include "axi4_stream_hmc_monitor.sv" |
`include "bfm_2_hmc_monitor.sv" |
83,23 → 82,17
axi4_stream_if #( |
.DATA_BYTES(`AXI4BYTES), |
.TUSER_WIDTH(`AXI4BYTES) |
) axi4_hmc_req_if( |
.ACLK(clk_user), |
.ARESET_N(res_n) |
); |
) axi4_hmc_req_if(); |
|
axi4_stream_if #( |
.DATA_BYTES(`AXI4BYTES), |
.TUSER_WIDTH(`AXI4BYTES) |
) axi4_hmc_rsp_if( |
.ACLK(clk_user), |
.ARESET_N(res_n) |
); |
) axi4_hmc_rsp_if(); |
|
cag_rgm_rfs_if #( |
.ADDR_WIDTH(`RFS_HMC_CONTROLLER_RF_AWIDTH), |
.READ_DATA_WIDTH(`RFS_HMC_CONTROLLER_RF_RWIDTH), |
.WRITE_DATA_WIDTH(`RFS_HMC_CONTROLLER_RF_WWIDTH) |
.ADDR_WIDTH(`RFS_OPENHMC_RF_AWIDTH), |
.READ_DATA_WIDTH(`RFS_OPENHMC_RF_RWIDTH), |
.WRITE_DATA_WIDTH(`RFS_OPENHMC_RF_WWIDTH) |
) rfs_hmc_if(); |
|
dut dut_I ( |
122,9 → 115,6
uvm_config_db#(pkt_analysis_port#())::set(null,"uvm_test_top.hmc_tb0.hmc_module.hmc_req_mon","mb_pkt",dut_I.hmc_bfm0.hmc_flit_top.mb_rsp_pkt[0]); |
uvm_config_db#(pkt_analysis_port#())::set(null,"uvm_test_top.hmc_tb0.hmc_module.hmc_rsp_mon","mb_pkt",dut_I.hmc_bfm0.hmc_flit_top.mb_req_pkt[0]); |
|
//uvm_config_db#(pkt_analysis_port#())::set(null,"uvm_test_top.hmc_tb0.hmc_module.hmc_req_mon","mb_pkt",dut_I.hmc_bfm0.hmc_flit_top.mb_req_pkt_err_cov[0]); |
//uvm_config_db#(pkt_analysis_port#())::set(null,"uvm_test_top.hmc_tb0.hmc_module.hmc_rsp_mon","mb_pkt",dut_I.hmc_bfm0.hmc_flit_top.mb_rsp_pkt_err_cov[0]); |
|
run_test(); |
end |
|
132,7 → 122,7
clk_user <= 1'b1; |
clk_hmc_refclk <= 1'b1; |
res_n <= 1'b0; |
#1000ns |
#500ns; |
@(posedge clk_user) res_n <= 1'b1; |
end |
|
167,7 → 157,7
endcase |
end |
|
//-- 125 MHz |
//-- 125 MHz HMC/Transceiver refclock |
always #4ns clk_hmc_refclk <= ~clk_hmc_refclk; |
|
|
endmodule : tb_top |
/bfm/src/hmc_tb.sv
64,14 → 64,14
hmc_link_config link_cfg; |
|
cag_rgm_rfs_env #( |
.ADDR_WIDTH(`RFS_HMC_CONTROLLER_RF_AWIDTH), |
.READ_DATA_WIDTH(`RFS_HMC_CONTROLLER_RF_RWIDTH), |
.WRITE_DATA_WIDTH(`RFS_HMC_CONTROLLER_RF_WWIDTH) |
.ADDR_WIDTH(`RFS_OPENHMC_RF_AWIDTH), |
.READ_DATA_WIDTH(`RFS_OPENHMC_RF_RWIDTH), |
.WRITE_DATA_WIDTH(`RFS_OPENHMC_RF_WWIDTH) |
) rfs_hmc_I; |
|
rf_hmc_controller_rf_c rf_model_hmc; |
rf_openhmc_rf_c rf_model_hmc; |
|
hmc_vseqr v_seqr; |
vseqr v_seqr; |
|
int i = 2; |
|
143,10 → 143,10
|
hmc_module = hmc_module_env::type_id::create("hmc_module",this); |
|
rfs_hmc_I = cag_rgm_rfs_env #(.ADDR_WIDTH(`RFS_HMC_CONTROLLER_RF_AWIDTH), .READ_DATA_WIDTH(`RFS_HMC_CONTROLLER_RF_RWIDTH),.WRITE_DATA_WIDTH(`RFS_HMC_CONTROLLER_RF_WWIDTH))::type_id::create("rfs_hmc_I", this); |
rf_model_hmc = rf_hmc_controller_rf_c::type_id::create("rf_model_hmc",this); |
rfs_hmc_I = cag_rgm_rfs_env #(.ADDR_WIDTH(`RFS_OPENHMC_RF_AWIDTH), .READ_DATA_WIDTH(`RFS_OPENHMC_RF_RWIDTH),.WRITE_DATA_WIDTH(`RFS_OPENHMC_RF_WWIDTH))::type_id::create("rfs_hmc_I", this); |
rf_model_hmc = rf_openhmc_rf_c::type_id::create("rf_model_hmc",this); |
|
v_seqr = hmc_vseqr::type_id::create("v_seqr", this); |
v_seqr = vseqr::type_id::create("v_seqr", this); |
|
endfunction : build_phase |
|
200,6 → 200,8
v_seqr.rf_seqr_hmc = rfs_hmc_I.sequencer; |
|
|
v_seqr.scb = hmc_module.scb; |
|
endfunction : connect_phase |
|
endclass : hmc_tb |
/bfm/src/vseqr.sv
0,0 → 1,85
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
`ifndef hmc_VIRTUAL_SEQUENCER_SV |
`define hmc_VIRTUAL_SEQUENCER_SV |
|
class vseqr extends uvm_sequencer; |
|
hmc_link_config link_cfg; |
|
cls_link_cfg hmc_link_cfg; |
|
//-- references to testbench sequencers |
cag_rgm_sequencer rf_seqr_hmc; |
|
hmc_module_scb scb; |
|
hmc_2_axi4_sequencer #(.DATA_BYTES(`AXI4BYTES),.TUSER_WIDTH(`AXI4BYTES)) axi4_req_seqr; |
|
`uvm_component_utils_begin(vseqr) |
`uvm_field_object(link_cfg, UVM_DEFAULT) |
`uvm_component_utils_end |
|
function new (string name = "hmc_virtual_sequencer", uvm_component parent); |
super.new(name, parent); |
|
hmc_link_cfg = new(); |
endfunction : new |
|
|
function void build_phase(uvm_phase phase); |
super.build_phase(phase); |
|
if (!uvm_config_db#(hmc_link_config)::get(this, "", "link_cfg", link_cfg)) begin |
uvm_report_fatal(get_type_name(), $psprintf("hmc_link_config not set via config_db")); |
end |
|
|
endfunction : build_phase |
|
|
//function void connect_phase(uvm_phase phase); |
// |
//endfunction : connect_phase |
|
|
endclass : vseqr |
|
`endif // hmc_VIRTUAL_SEQUENCER_SV |
/bfm/src/targets/dut_openhmc_behavioral_bfm.sv
73,7 → 73,9
wire [NUM_LANES-1:0] bit_slip; |
wire [NUM_LANES-1:0] phy_lane_polarity; |
bit P_RST_N; |
wire clk_hmc = clk_user; |
//If transceiver models are used, clk_hmc should be sourced from the transceiver outclock and res_n hmc can be set independently |
wire clk_hmc = clk_user; |
wire res_n_hmc = res_n; |
|
// Wire the HMC BFM model |
wire LxRXPS; // HMC input |
96,8 → 98,14
|
//----------------------------- Attach the Register File System interface |
assign rfs_hmc_if.clk = clk_hmc; |
assign rfs_hmc_if.res_n = res_n; |
assign rfs_hmc_if.res_n = res_n_hmc; |
|
//Assign the AXI4 IF |
assign axi4_req.ACLK = (`OPENHMC_ASYNC_FIFOS==0) ? clk_hmc : clk_user; |
assign axi4_rsp.ACLK = (`OPENHMC_ASYNC_FIFOS==0) ? clk_hmc : clk_user; |
assign axi4_req.ARESET_N = (`OPENHMC_ASYNC_FIFOS==0) ? res_n_hmc : res_n; |
assign axi4_rsp.ARESET_N = (`OPENHMC_ASYNC_FIFOS==0) ? res_n_hmc : res_n; |
|
//----------------------------- Generate Clocks |
bit clk_10G; |
generate |
108,6 → 116,7
endgenerate |
|
//----------------------------- Behavioral SerDes |
bit LxTXPS_synced; |
genvar lane; |
generate |
begin : serializers_gen |
117,6 → 126,7
.DWIDTH(LANE_WIDTH) |
) serializer_I ( |
.clk(clk_hmc), |
.res_n(res_n), |
.fast_clk(clk_10G), |
.data_in(to_serializers[lane*LANE_WIDTH+LANE_WIDTH-1:lane*LANE_WIDTH]), |
.data_out(serial_Txp[lane]) |
125,6 → 135,7
.DWIDTH(LANE_WIDTH) |
) deserializer_I ( |
.clk(clk_hmc), |
.res_n(LxTXPS_synced && res_n), |
.fast_clk(clk_10G), |
.bit_slip(bit_slip[lane]), |
.lane_polarity(phy_lane_polarity[lane]), |
134,7 → 145,7
end |
end |
endgenerate |
|
always @(posedge clk_hmc) LxTXPS_synced <= LxTXPS; |
//===================================================================================================== |
//----------------------------------------------------------------------------------------------------- |
//---------INSTANTIATIONS HERE------------------------------------------------------------------------- |
145,11 → 156,14
.FPW(FPW), |
.LOG_NUM_LANES(LOG_NUM_LANES), |
//Configure the Functionality |
.LOG_MAX_RTC(10), //That is max 1023 Tokens |
.LOG_MAX_RX_TOKENS(10), |
.LOG_MAX_HMC_TOKENS(10), //That is max 1023 Tokens |
.HMC_RX_AC_COUPLED(1), |
.CTRL_LANE_POLARITY(0), |
.CTRL_LANE_POLARITY(1), |
.CTRL_LANE_REVERSAL(1), |
.BITSLIP_SHIFT_RIGHT(1), |
.OPEN_RSP_MODE(`OPEN_RSP_MODE), |
.SYNC_AXI4_IF(`OPENHMC_ASYNC_FIFOS==0), |
//Debug Logic |
.DBG_RX_TOKEN_MON(1) //Required by the test check sequence |
) |
184,15 → 198,17
.phy_data_tx_link2phy(to_serializers), |
.phy_data_rx_phy2link(from_deserializers), |
.phy_bit_slip(bit_slip), |
.phy_ready(res_n), |
.phy_tx_ready(res_n), |
.phy_rx_ready(res_n), |
.phy_lane_polarity(phy_lane_polarity), |
.phy_init_cont_set(), |
|
//---------------------------------- |
//----Connect HMC |
//---------------------------------- |
.P_RST_N(P_RST_N), |
.hmc_LxRXPS(LxRXPS), |
.hmc_LxTXPS(LxTXPS), |
.LXRXPS(LxRXPS), |
.LXTXPS(LxTXPS), |
.FERR_N(FERR_N), |
|
//---------------------------------- |
/run/clean_up.sh
42,4 → 42,7
rm -rf cov_work |
rm -f *.log |
rm -f irun.key |
rm -rf .simvision |
rm -rf .simvision |
rm -rf .rmi_process |
rm -f *.diag |
rm -f *.err |
/run/run_bfm.sh
0,0 → 1,83
# |
# .--------------. .----------------. .------------. |
# | .------------. | .--------------. | .----------. | |
# | | ____ ____ | | | ____ ____ | | | ______ | | |
# | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
# ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
# / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
# (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
# \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
# | | | | | | | | | | | | |
# |_| | '------------' | '--------------' | '----------' | |
# '--------------' '----------------' '------------' |
# |
# openHMC - An Open Source Hybrid Memory Cube Controller |
# (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
# www.ziti.uni-heidelberg.de |
# B6, 26 |
# 68159 Mannheim |
# Germany |
# |
# Contact: openhmc@ziti.uni-heidelberg.de |
# http://ra.ziti.uni-heidelberg.de/openhmc |
# |
# This source file is free software: you can redistribute it and/or modify |
# it under the terms of the GNU Lesser General Public License as published by |
# the Free Software Foundation, either version 3 of the License, or |
# (at your option) any later version. |
# |
# This source file is distributed in the hope that it will be useful, |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
# GNU Lesser General Public License for more details. |
# |
# You should have received a copy of the GNU Lesser General Public License |
# along with this source file. If not, see <http://www.gnu.org/licenses/>. |
# |
# |
|
#!/bin/bash |
|
if [ ! $OPENHMC_SIM ] |
then |
echo "Please export OPENHMC_SIM first" |
exit 1 |
fi |
|
if [ ! $OPENHMC_PATH ] |
then |
echo "Please export OPENHMC_PATH first" |
exit 1 |
fi |
|
export CAG_TB_DIR=${OPENHMC_SIM}/tb/bfm |
export CAG_DUT="openhmc_behavioral_bfm" |
|
#----------------------------------------------------------------- |
|
echo "" |
echo "*" |
echo "* .--------------. .----------------. .------------. " |
echo "* | .------------. | .--------------. | .----------. |" |
echo "* | | ____ ____ | | | ____ ____ | | | ______ | |" |
echo "* | ||_ || _|| | ||_ \ / _|| | | .' ___ || |" |
echo "* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| |" |
echo "* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | |" |
echo "* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ '.___.'\| |" |
echo "* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | '._____.'| |" |
echo "* | | | | | | | | | | | |" |
echo "* |_| | ------------ | '--------------' | '----------' |" |
echo "* '--------------' '----------------' '------------' " |
echo "*" |
echo "*" |
echo "* *******************************************************" |
echo "* * *" |
echo "* * openHMC Verification Environment *" |
echo "* * *" |
echo "* * using Micron Bus Functional Model *" |
echo "* * *" |
echo "* *******************************************************" |
echo "" |
|
${OPENHMC_SIM}/tb/run/run_files/run.sh $* |
|
/run/run_files/run.sh
39,7 → 39,7
#!/bin/bash |
|
function print_help { |
printf "Usage: %s: [-c] [-d DUT] [-f FPW] [-g] [-l NUM_LANES] [o] [-q] [-p] [-s SEED] [-t TEST_NAME] [-v UVM_VERBOSITY] -?\n" $(basename $0) >&2 |
printf "Usage: %s: [-c] [-d DUT] [-f FPW] [-g] [-l NUM_LANES] [-o] [-q] [-a] [-r] [-s SEED] [-t TEST_NAME] [-v UVM_VERBOSITY] -?\n" $(basename $0) >&2 |
} |
|
#----------------------------------------------------------------- |
54,6 → 54,9
log_num_lanes="3" |
fpw="default" |
log_fpw="2" |
num_axi_bytes="64" |
open_rsp="0" |
async_fifos="0" |
|
do_clean_up= |
tflag="0" |
63,14 → 66,15
use_gui= |
input_file="-input ${CAG_TB_DIR}/build/ncsim.tcl" |
seed="" |
num_axi_bytes="64" |
enable_coverage="" |
|
|
#-- parse options |
while getopts 'cgot:v:d:s:l:f:q?' OPTION |
while getopts 'acgort:v:d:s:l:f:q?' OPTION |
do |
case $OPTION in |
a) async_fifos="1" |
;; |
c) do_clean_up=1 |
;; |
d) export CAG_DUT=${OPTARG} |
82,6 → 86,13
;; |
l) num_lanes="${OPTARG}" |
;; |
o) enable_coverage="-coverage all -covoverwrite" |
;; |
q) input_file="" |
verbosity="UVM_NONE" |
;; |
r) open_rsp="1" |
;; |
s) seed="+svseed+${OPTARG}" |
;; |
t) tflag="1" |
89,11 → 100,6
;; |
v) verbosity="$OPTARG" |
;; |
o) enable_coverage="-coverage all -covoverwrite" |
;; |
q) input_file="" |
verbosity="UVM_NONE" |
;; |
?) print_help |
exit 2 |
;; |
160,6 → 166,18
test_name="simple_test" |
fi |
|
#-- Open Response |
if [ "$open_rsp" == "1" ] |
then |
printf "*** OPEN RESPONSE LOOP MODE ***\n" |
fi |
|
#-- Async FIFOs |
if [ "$open_rsp" == "1" ] |
then |
printf "*** Using Asynchronous FIFOs ***\n" |
fi |
|
#-- select DUT |
if [ "$dflag" == "0" ] |
then |
185,5 → 203,8
-f ${CAG_TB_COMPILE_IUS} \ |
${enable_coverage} \ |
-access +rwc \ |
"-define OPEN_RSP_MODE=$open_rsp" \ |
"-define OPENHMC_ASYNC_FIFOS=$async_fifos" \ |
-timescale 1ns/1ps \ |
${use_gui} "+UVM_TESTNAME=${test_name}" "+UVM_VERBOSITY=${verbosity}" ${seed} \ |
"-define LOG_NUM_LANES=$log_num_lanes -define FPW=$fpw -define LOG_FPW=$log_fpw -define AXI4BYTES=$num_axi_bytes" $* |
/run/run.sh
50,8 → 50,8
exit 1 |
fi |
|
export CAG_TB_DIR=${OPENHMC_SIM}/tb/bfm |
export CAG_DUT="openhmc_behavioral_bfm" |
export CAG_TB_DIR=${OPENHMC_SIM}/tb/uvc |
export CAG_DUT="openhmc_behavioral_uvc" |
|
#----------------------------------------------------------------- |
|
74,8 → 74,8
echo "* * *" |
echo "* * openHMC Verification Environment *" |
echo "* * *" |
echo "* * using CAG HMC Verification Model *" |
echo "* * *" |
echo "* * *" |
echo "* *******************************************************" |
echo "" |
|
/common/build/compile_hw_openhmc.f
0,0 → 1,44
# |
# .--------------. .----------------. .------------. |
# | .------------. | .--------------. | .----------. | |
# | | ____ ____ | | | ____ ____ | | | ______ | | |
# | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
# ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
# / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
# (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
# \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
# | | | | | | | | | | | | |
# |_| | '------------' | '--------------' | '----------' | |
# '--------------' '----------------' '------------' |
# |
# openHMC - An Open Source Hybrid Memory Cube Controller |
# (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
# www.ziti.uni-heidelberg.de |
# B6, 26 |
# 68159 Mannheim |
# Germany |
# |
# Contact: openhmc@ziti.uni-heidelberg.de |
# http://ra.ziti.uni-heidelberg.de/openhmc |
# |
# This source file is free software: you can redistribute it and/or modify |
# it under the terms of the GNU Lesser General Public License as published by |
# the Free Software Foundation, either version 3 of the License, or |
# (at your option) any later version. |
# |
# This source file is distributed in the hope that it will be useful, |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
# GNU Lesser General Public License for more details. |
# |
# You should have received a copy of the GNU Lesser General Public License |
# along with this source file. If not, see <http://www.gnu.org/licenses/>. |
# |
# |
|
#openHMC controller |
-f ${OPENHMC_PATH}/rtl/hmc_controller/openhmc_top.f |
+incdir+${OPENHMC_PATH}/rtl/include/ |
|
#Include Register File model |
+incdir+${OPENHMC_SIM}/tb/common/src/rgm/openhmc/ |
/common/build/compile_tb_openhmc.f
0,0 → 1,87
# |
# .--------------. .----------------. .------------. |
# | .------------. | .--------------. | .----------. | |
# | | ____ ____ | | | ____ ____ | | | ______ | | |
# | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
# ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
# / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
# (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
# \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
# | | | | | | | | | | | | |
# |_| | '------------' | '--------------' | '----------' | |
# '--------------' '----------------' '------------' |
# |
# openHMC - An Open Source Hybrid Memory Cube Controller |
# (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
# www.ziti.uni-heidelberg.de |
# B6, 26 |
# 68159 Mannheim |
# Germany |
# |
# Contact: openhmc@ziti.uni-heidelberg.de |
# http://ra.ziti.uni-heidelberg.de/openhmc |
# |
# This source file is free software: you can redistribute it and/or modify |
# it under the terms of the GNU Lesser General Public License as published by |
# the Free Software Foundation, either version 3 of the License, or |
# (at your option) any later version. |
# |
# This source file is distributed in the hope that it will be useful, |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
# GNU Lesser General Public License for more details. |
# |
# You should have received a copy of the GNU Lesser General Public License |
# along with this source file. If not, see <http://www.gnu.org/licenses/>. |
# |
# |
|
#Leave untouched |
+define+HMC_REQUESTER_IS_ACTIVE=0 |
+define+HMC_RESPONDER_IS_ACTIVE=0 |
+define+CAG_ASSERTIONS |
+define+SIMULATION |
|
+define+RFS_DATA_WIDTH=64 |
+define+RFS_OPENHMC_RF_AWIDTH=4 |
+define+RFS_OPENHMC_RF_RWIDTH=64 |
+define+RFS_OPENHMC_RF_WWIDTH=64 |
|
+incdir+${OPENHMC_SIM}/tb/common/src |
+incdir+${OPENHMC_SIM}/tb/common/testlib |
+incdir+${OPENHMC_SIM}/UVC/axi4_stream/sv |
+incdir+${OPENHMC_SIM}/UVC/cag_rgm/sv |
+incdir+${OPENHMC_SIM}/UVC/hmc_module/sv |
+incdir+${OPENHMC_SIM}/UVC/hmc_base_types/sv |
|
-64bit |
-access +rwc |
|
-linedebug |
-ida |
|
-uvm |
|
|
#-coverage All |
#-covoverwrite |
|
-sv |
-q |
|
-ncerror CUVWSI |
-ncerror CUVWSP |
-ncerror CUVMPW |
-ncerror CUVUKP |
-ncerror RTSDAD |
-ncerror OBINRG |
-ncerror BNDMEM |
-ncerror FUNTSK |
-ncerror CSINFI |
-ncerror RECOME |
-nowarn CUVIHR |
+UVM_NO_RELNOTES |
|
### DUT-specific files |
|
-top tb_top |
/common/testlib/openhmc_check_seq.sv
0,0 → 1,131
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
`ifndef openhmc_check_seq |
`define openhmc_check_seq |
|
|
class openhmc_check_seq extends hmc_base_seq; |
|
function new(string name="openhmc_check_seq"); |
super.new(name); |
endfunction : new |
|
`uvm_object_utils(openhmc_check_seq) |
`uvm_declare_p_sequencer(vseqr) |
|
int timer; |
int q_size, q_size_prev; |
int draintime = 200; |
|
task body(); |
reg_openhmc_rf_status_general_c status; |
reg_openhmc_rf_sent_np_c sent_np; |
reg_openhmc_rf_rcvd_rsp_c rcvd_rsp; |
|
`uvm_info(get_type_name(), "Running Check Sequence", UVM_NONE) |
|
timer = 0; |
q_size_prev = 0; |
|
$cast(status,p_sequencer.rf_seqr_hmc.get_by_name("status_general")); |
status.set_check_on_read(1'b0); |
|
$cast(sent_np,p_sequencer.rf_seqr_hmc.get_by_name("sent_np")); |
sent_np.set_check_on_read(1'b0); |
|
$cast(rcvd_rsp,p_sequencer.rf_seqr_hmc.get_by_name("rcvd_rsp")); |
rcvd_rsp.set_check_on_read(1'b0); |
|
p_sequencer.rf_seqr_hmc.read_reg(status); |
p_sequencer.rf_seqr_hmc.read_reg(sent_np); |
p_sequencer.rf_seqr_hmc.read_reg(rcvd_rsp); |
|
|
while( |
((p_sequencer.scb.axi4_np_requests.size() ) || |
(status.fields.rx_tokens_remaining_ != ((p_sequencer.link_cfg.cfg_rsp_open_loop==UVM_ACTIVE) ? status.fields.rx_tokens_remaining_ :p_sequencer.link_cfg.rx_tokens)) || |
(status.fields.hmc_tokens_remaining_ != p_sequencer.link_cfg.hmc_tokens) ) |
&& |
(timer < draintime) |
) begin |
#1us; |
p_sequencer.rf_seqr_hmc.read_reg(status); |
p_sequencer.rf_seqr_hmc.read_reg(sent_np); |
p_sequencer.rf_seqr_hmc.read_reg(rcvd_rsp); |
|
if(p_sequencer.link_cfg.cfg_rsp_open_loop==UVM_ACTIVE) |
`uvm_info(get_type_name(), "OPEN RESPONSE LOOP MODE. openHMC tokens not checked.", UVM_NONE) |
else |
`uvm_info(get_type_name(),$psprintf("RX token count in TX_LINK = %0d, should be %0d", status.fields.rx_tokens_remaining_, p_sequencer.link_cfg.rx_tokens),UVM_LOW) |
|
q_size = p_sequencer.scb.axi4_np_requests.size(); |
`uvm_info(get_type_name(), $psprintf("Scoreboard open response queue size = %d",q_size) , UVM_NONE) |
`uvm_info(get_type_name(),$psprintf("HMC token count in TX_LINK = %0d, should be %0d", status.fields.hmc_tokens_remaining_, p_sequencer.link_cfg.hmc_tokens),UVM_LOW) |
`uvm_info(get_type_name(),$psprintf("sent = %0d non-posted packets, received %0d responses", sent_np.fields.cnt_, rcvd_rsp.fields.cnt_),UVM_LOW) |
|
if(q_size==q_size_prev) begin |
timer++; |
end else begin |
timer=0; |
end |
q_size_prev = q_size; |
|
end |
#1us; |
|
p_sequencer.rf_seqr_hmc.read_reg(status); |
p_sequencer.rf_seqr_hmc.read_reg(sent_np); |
p_sequencer.rf_seqr_hmc.read_reg(rcvd_rsp); |
|
#5us; |
|
//-- ***REPORTS*** |
//-- Report Packet Counts |
if( timer==draintime ) begin |
`uvm_info(get_type_name(),$psprintf("Counted: %0d NP Requests, %0d Responses", sent_np.fields.cnt_, rcvd_rsp.fields.cnt_), UVM_LOW) |
`uvm_info(get_type_name(),$psprintf("Responder token count in TX_LINK = %0d, should be %0d", status.fields.hmc_tokens_remaining_, p_sequencer.link_cfg.hmc_tokens), UVM_LOW) |
`uvm_fatal(get_type_name(),$psprintf("Requester token count in TX_LINK = %0d, should be %0d", status.fields.rx_tokens_remaining_, p_sequencer.link_cfg.rx_tokens)) |
end |
|
endtask : body |
|
endclass : openhmc_check_seq |
|
`endif // openhmc_check_seq |
/common/testlib/non_posted_pkt_test/non_posted_pkt_test_seq.sv
0,0 → 1,108
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// non_posted_pkt_test sequence |
// |
// |
|
|
`ifndef non_posted_pkt_test_SEQ_SV |
`define non_posted_pkt_test_SEQ_SV |
|
class non_posted_pkt_test_seq extends hmc_base_seq; |
|
rand int iterations; |
|
constraint iterations_c { |
iterations >= 1; |
iterations <= 10; |
} |
|
openhmc_init_seq init; |
hmc_model_init_seq bfm; |
openhmc_check_seq check; |
hmc_base_pkt_seq work; |
|
hmc_big_pkts_seq b_pkt; |
hmc_small_pkts_seq s_pkt; |
|
hmc_big_pkts_hdelay_seq b_h_pkt; |
hmc_big_pkts_zdelay_seq b_z_pkt; |
hmc_small_pkts_hdelay_seq s_h_pkt; |
hmc_small_pkts_zdelay_seq s_z_pkt; |
|
function new(string name="non_posted_pkt_test_seq"); |
super.new(name); |
endfunction : new |
|
`uvm_object_utils(non_posted_pkt_test_seq) |
`uvm_declare_p_sequencer(vseqr) |
|
virtual task body(); |
|
`uvm_info(get_type_name(), "starting non_posted_pkt_test_seq", UVM_NONE) |
|
`uvm_do(bfm) |
#1us; |
`uvm_do(init) |
#1us; |
//-- write your test here |
|
repeat (iterations) |
randcase |
1 : `uvm_do_with( work,{req_class == NON_POSTED;}) |
1 : `uvm_do_with( b_pkt,{req_class == NON_POSTED;}) |
1 : `uvm_do_with( s_pkt,{req_class == NON_POSTED;}) |
1 : `uvm_do_with(b_h_pkt,{req_class == NON_POSTED;}) |
1 : `uvm_do_with(s_h_pkt,{req_class == NON_POSTED;}) |
1 : `uvm_do_with(b_z_pkt,{req_class == NON_POSTED;}) |
1 : `uvm_do_with(s_z_pkt,{req_class == NON_POSTED;}) |
endcase |
|
`uvm_do(check) |
#1us; |
`uvm_info(get_type_name(), "non_posted_pkt_test_seq done", UVM_NONE) |
|
endtask : body |
|
endclass : non_posted_pkt_test_seq |
|
`endif // non_posted_pkt_test_SEQ_SV |
/common/testlib/non_posted_pkt_test/non_posted_pkt_test.sv
0,0 → 1,77
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// non_posted_pkt_test test |
// |
// |
|
// test description: |
// add a description of the test here |
|
|
`ifndef non_posted_pkt_test_SV |
`define non_posted_pkt_test_SV |
|
class non_posted_pkt_test extends hmc_base_test; |
|
`uvm_component_utils(non_posted_pkt_test) |
|
|
function new(string name = "non_posted_pkt_test", uvm_component parent = null); |
super.new(name,parent); |
endfunction : new |
|
|
virtual function void build_phase(uvm_phase phase); |
|
uvm_config_db#(uvm_object_wrapper)::set(this,"hmc_tb0.v_seqr.run_phase","default_sequence",non_posted_pkt_test_seq::type_id::get()); |
|
super.build_phase(phase); |
|
endfunction : build_phase |
|
task run_phase(uvm_phase phase); |
phase.phase_done.set_drain_time(this, 1us); |
endtask : run_phase |
|
endclass : non_posted_pkt_test |
|
`endif // non_posted_pkt_test_SV |
/common/testlib/small_pkt_test/small_pkt_test_seq.sv
0,0 → 1,83
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// small_pkt_test sequence |
// |
// |
|
|
`ifndef small_pkt_test_SEQ_SV |
`define small_pkt_test_SEQ_SV |
|
class small_pkt_test_seq extends hmc_base_seq; |
|
openhmc_init_seq init; |
hmc_model_init_seq bfm; |
openhmc_check_seq check; |
hmc_small_pkts_seq work; |
|
function new(string name="small_pkt_test_seq"); |
super.new(name); |
endfunction : new |
|
`uvm_object_utils(small_pkt_test_seq) |
`uvm_declare_p_sequencer(vseqr) |
|
virtual task body(); |
|
`uvm_info(get_type_name(), "starting small_pkt_test_seq", UVM_NONE) |
|
`uvm_do(bfm) |
#1us; |
`uvm_do(init) |
#1us; |
//-- write your test here |
`uvm_do(work) |
|
`uvm_do(check) |
#1us; |
`uvm_info(get_type_name(), "small_pkt_test_seq done", UVM_NONE) |
|
endtask : body |
|
endclass : small_pkt_test_seq |
|
`endif // small_pkt_test_SEQ_SV |
/common/testlib/small_pkt_test/small_pkt_test.sv
0,0 → 1,77
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// small_pkt_test test |
// |
// |
|
// test description: |
// add a description of the test here |
|
|
`ifndef small_pkt_test_SV |
`define small_pkt_test_SV |
|
class small_pkt_test extends hmc_base_test; |
|
`uvm_component_utils(small_pkt_test) |
|
|
function new(string name = "small_pkt_test", uvm_component parent = null); |
super.new(name,parent); |
endfunction : new |
|
|
virtual function void build_phase(uvm_phase phase); |
|
uvm_config_db#(uvm_object_wrapper)::set(this,"hmc_tb0.v_seqr.run_phase","default_sequence",small_pkt_test_seq::type_id::get()); |
|
super.build_phase(phase); |
|
endfunction : build_phase |
|
task run_phase(uvm_phase phase); |
phase.phase_done.set_drain_time(this, 1us); |
endtask : run_phase |
|
endclass : small_pkt_test |
|
`endif // small_pkt_test_SV |
/common/testlib/big_pkt_zdelay_test/big_pkt_zdelay_test_seq.sv
0,0 → 1,82
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// big_pkt_zdelay_test sequence |
// |
// |
|
|
`ifndef big_pkt_zdelay_test_SEQ_SV |
`define big_pkt_zdelay_test_SEQ_SV |
|
class big_pkt_zdelay_test_seq extends hmc_base_seq; |
|
openhmc_init_seq init; |
hmc_model_init_seq bfm; |
openhmc_check_seq check; |
hmc_big_pkts_zdelay_seq work; |
|
function new(string name="big_pkt_zdelay_test_seq"); |
super.new(name); |
endfunction : new |
|
`uvm_object_utils(big_pkt_zdelay_test_seq) |
`uvm_declare_p_sequencer(vseqr) |
|
virtual task body(); |
|
`uvm_info(get_type_name(), "starting big_pkt_zdelay_test_seq", UVM_NONE) |
|
`uvm_do(bfm) |
#1us; |
`uvm_do(init) |
#1us; |
//-- write your test here |
`uvm_do(work) |
|
`uvm_info(get_type_name(), "big_pkt_zdelay_test_seq done", UVM_NONE) |
`uvm_do(check) |
|
endtask : body |
|
endclass : big_pkt_zdelay_test_seq |
|
`endif // big_pkt_zdelay_test_SEQ_SV |
/common/testlib/big_pkt_zdelay_test/big_pkt_zdelay_test.sv
0,0 → 1,77
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// big_pkt_zdelay_test test |
// |
// |
|
// test description: |
// add a description of the test here |
|
|
`ifndef big_pkt_zdelay_test_SV |
`define big_pkt_zdelay_test_SV |
|
class big_pkt_zdelay_test extends hmc_base_test; |
|
`uvm_component_utils(big_pkt_zdelay_test) |
|
|
function new(string name = "big_pkt_zdelay_test", uvm_component parent = null); |
super.new(name,parent); |
endfunction : new |
|
|
virtual function void build_phase(uvm_phase phase); |
|
uvm_config_db#(uvm_object_wrapper)::set(this,"hmc_tb0.v_seqr.run_phase","default_sequence",big_pkt_zdelay_test_seq::type_id::get()); |
|
super.build_phase(phase); |
|
endfunction : build_phase |
|
task run_phase(uvm_phase phase); |
phase.phase_done.set_drain_time(this, 1us); |
endtask : run_phase |
|
endclass : big_pkt_zdelay_test |
|
`endif // big_pkt_zdelay_test_SV |
/common/testlib/bit_error_test/bit_error_test_seq.sv
0,0 → 1,94
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// bit_error_test sequence |
// |
// |
|
`ifndef bit_error_test_SEQ_SV |
`define bit_error_test_SEQ_SV |
|
class bit_error_test_seq extends hmc_base_seq; |
|
rand int iterations; |
|
constraint iterations_c { |
iterations >= 1; |
iterations <= 2; |
} |
|
function new(string name="bit_error_test_seq"); |
super.new(name); |
endfunction : new |
|
openhmc_init_seq init; |
hmc_model_init_seq bfm; |
openhmc_check_seq check; |
hmc_base_pkt_seq work; |
|
`uvm_object_utils(bit_error_test_seq) |
`uvm_declare_p_sequencer(vseqr) |
|
hmc_2_axi4_sequence #(.DATA_BYTES(`AXI4BYTES), .TUSER_WIDTH(`AXI4BYTES)) requests; |
|
virtual task body(); |
|
`uvm_info(get_type_name(), "starting bit_error_test_seq", UVM_NONE) |
|
`uvm_do(bfm) |
#1us; |
`uvm_do(init) |
#1us; |
|
repeat (iterations) |
randcase |
1 : `uvm_do_with(work, {req_class == NON_POSTED; }) |
1 : `uvm_do_with(work, {req_class == POSTED; }) |
endcase |
|
`uvm_info(get_type_name(), "bit_error_test_seq done", UVM_NONE) |
`uvm_do(check) |
|
endtask : body |
|
endclass : bit_error_test_seq |
|
`endif // bit_error_test_SEQ_SV |
/common/testlib/bit_error_test/bit_error_test.sv
0,0 → 1,80
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// bit_error_test test |
// |
// |
|
`ifndef bit_error_test_SV |
`define bit_error_test_SV |
|
class bit_error_test extends hmc_base_test; |
|
`uvm_component_utils(bit_error_test) |
|
|
function new(string name = "bit_error_test", uvm_component parent = null); |
super.new(name,parent); |
endfunction : new |
|
|
virtual function void build_phase(uvm_phase phase); |
|
uvm_config_db#(uvm_object_wrapper)::set(this,"hmc_tb0.v_seqr.run_phase","default_sequence",bit_error_test_seq::type_id::get()); |
|
super.build_phase(phase); |
link_cfg.requester.errors_enabled = 0; |
link_cfg.responder.errors_enabled = 0; |
|
link_cfg.requester.lane_errors_enabled = 1; |
link_cfg.responder.lane_errors_enabled = 1; |
|
link_cfg_randomize : assert (link_cfg.randomize()); |
|
endfunction : build_phase |
|
task run_phase(uvm_phase phase); |
phase.phase_done.set_drain_time(this, 1us); |
endtask : run_phase |
|
endclass : bit_error_test |
|
`endif // bit_error_test_SV |
/common/testlib/simple_test/simple_test.sv
0,0 → 1,73
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// simple_test test |
// |
// |
|
`ifndef simple_test_SV |
`define simple_test_SV |
|
class simple_test extends hmc_base_test; |
|
`uvm_component_utils(simple_test) |
|
|
function new(string name = "simple_test", uvm_component parent = null); |
super.new(name,parent); |
endfunction : new |
|
|
virtual function void build_phase(uvm_phase phase); |
|
uvm_config_db#(uvm_object_wrapper)::set(this,"hmc_tb0.v_seqr.run_phase","default_sequence",simple_test_seq::type_id::get()); |
|
super.build_phase(phase); |
|
endfunction : build_phase |
|
task run_phase(uvm_phase phase); |
phase.phase_done.set_drain_time(this, 1us); |
endtask : run_phase |
|
endclass : simple_test |
|
`endif // simple_test_SV |
/common/testlib/simple_test/simple_test_seq.sv
0,0 → 1,94
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// simple_test sequence |
// |
// |
|
`ifndef simple_test_SEQ_SV |
`define simple_test_SEQ_SV |
|
class simple_test_seq extends hmc_base_seq; |
|
rand int iterations; |
|
constraint iterations_c { |
iterations >= 1; |
iterations <= 10; |
} |
|
function new(string name="simple_test_seq"); |
super.new(name); |
endfunction : new |
|
openhmc_init_seq init; |
hmc_model_init_seq bfm; |
openhmc_check_seq check; |
hmc_base_pkt_seq work; |
|
`uvm_object_utils(simple_test_seq) |
`uvm_declare_p_sequencer(vseqr) |
|
hmc_2_axi4_sequence #(.DATA_BYTES(`AXI4BYTES), .TUSER_WIDTH(`AXI4BYTES)) requests; |
|
virtual task body(); |
|
`uvm_info(get_type_name(), "starting simple_test_seq", UVM_NONE) |
|
`uvm_do(bfm) |
#1us; |
`uvm_do(init) |
#1us; |
|
repeat (iterations) |
randcase |
1 : `uvm_do_with(work, {req_class == NON_POSTED;}) |
1 : `uvm_do_with(work, {req_class == POSTED;}) |
endcase |
|
`uvm_info(get_type_name(), "simple_test_seq done", UVM_NONE) |
`uvm_do(check) |
|
endtask : body |
|
endclass : simple_test_seq |
|
`endif // simple_test_SEQ_SV |
/common/testlib/atomic_pkt_test/atomic_pkt_test.sv
0,0 → 1,77
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// atomic_pkt_test test |
// |
// |
|
// test description: |
// add a description of the test here |
|
|
`ifndef atomic_pkt_test_SV |
`define atomic_pkt_test_SV |
|
class atomic_pkt_test extends hmc_base_test; |
|
`uvm_component_utils(atomic_pkt_test) |
|
|
function new(string name = "atomic_pkt_test", uvm_component parent = null); |
super.new(name,parent); |
endfunction : new |
|
|
virtual function void build_phase(uvm_phase phase); |
|
uvm_config_db#(uvm_object_wrapper)::set(this,"hmc_tb0.v_seqr.run_phase","default_sequence",atomic_pkt_test_seq::type_id::get()); |
|
super.build_phase(phase); |
|
endfunction : build_phase |
|
task run_phase(uvm_phase phase); |
phase.phase_done.set_drain_time(this, 1us); |
endtask : run_phase |
|
endclass : atomic_pkt_test |
|
`endif // atomic_pkt_test_SV |
/common/testlib/atomic_pkt_test/atomic_pkt_test_seq.sv
0,0 → 1,101
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// atomic_pkt_test sequence |
// |
// |
|
|
`ifndef atomic_pkt_test_SEQ_SV |
`define atomic_pkt_test_SEQ_SV |
|
class atomic_pkt_test_seq extends hmc_base_seq; |
|
rand int iterations; |
|
constraint iterations_c { |
iterations >= 1; |
iterations <= 10; |
} |
|
openhmc_init_seq init; |
hmc_model_init_seq bfm; |
openhmc_check_seq check; |
hmc_base_pkt_seq work; |
|
hmc_hdelay_seq hdelay; |
hmc_zdelay_seq zdelay; |
|
|
function new(string name="atomic_pkt_test_seq"); |
super.new(name); |
endfunction : new |
|
`uvm_object_utils(atomic_pkt_test_seq) |
`uvm_declare_p_sequencer(vseqr) |
|
virtual task body(); |
|
`uvm_info(get_type_name(), "starting atomic_pkt_test_seq", UVM_NONE) |
|
`uvm_do(bfm) |
#1us; |
`uvm_do(init) |
#1us; |
//-- write your test here |
repeat(iterations) |
randcase |
1 : `uvm_do_with(work, {req_class == ATOMIC;}) |
1 : `uvm_do_with(hdelay, {req_class == ATOMIC;}) |
1 : `uvm_do_with(zdelay, {req_class == ATOMIC;}) |
endcase |
|
|
#1us; |
`uvm_do(check) |
#1us; |
`uvm_info(get_type_name(), "atomic_pkt_test_seq done", UVM_NONE) |
|
endtask : body |
|
endclass : atomic_pkt_test_seq |
|
`endif // atomic_pkt_test_SEQ_SV |
/common/testlib/test_lib.sv
0,0 → 1,106
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
//-- the base test |
`include "hmc_base_test.sv" |
|
|
//-- sequence lib |
`include "seq_lib/hmc_seq_lib.sv" |
|
//-- the init sequence |
`include "openhmc_init_seq.sv" |
|
//-- Set the HMC model |
`include "hmc_model_init_seq.sv" |
|
//-- check registers after test ends |
`include "openhmc_check_seq.sv" |
|
`include "simple_test/simple_test_seq.sv" |
`include "simple_test/simple_test.sv" |
|
`include "single_pkt_test/single_pkt_test_seq.sv" |
`include "single_pkt_test/single_pkt_test.sv" |
|
`include "sleep_mode_test/sleep_mode_test_seq.sv" |
`include "sleep_mode_test/sleep_mode_test.sv" |
|
`include "atomic_pkt_test/atomic_pkt_test.sv" |
`include "atomic_pkt_test/atomic_pkt_test_seq.sv" |
|
`include "big_pkt_hdelay_test/big_pkt_hdelay_test.sv" |
`include "big_pkt_hdelay_test/big_pkt_hdelay_test_seq.sv" |
|
`include "big_pkt_test/big_pkt_test.sv" |
`include "big_pkt_test/big_pkt_test_seq.sv" |
|
`include "small_pkt_test/small_pkt_test.sv" |
`include "small_pkt_test/small_pkt_test_seq.sv" |
|
`include "big_pkt_zdelay_test/big_pkt_zdelay_test.sv" |
`include "big_pkt_zdelay_test/big_pkt_zdelay_test_seq.sv" |
|
`include "high_delay_pkt_test/high_delay_pkt_test.sv" |
`include "high_delay_pkt_test/high_delay_pkt_test_seq.sv" |
|
`include "zero_delay_pkt_test/zero_delay_pkt_test.sv" |
`include "zero_delay_pkt_test/zero_delay_pkt_test_seq.sv" |
|
`include "non_posted_pkt_test/non_posted_pkt_test.sv" |
`include "non_posted_pkt_test/non_posted_pkt_test_seq.sv" |
|
`include "posted_pkt_test/posted_pkt_test.sv" |
`include "posted_pkt_test/posted_pkt_test_seq.sv" |
|
`include "small_pkt_hdelay_test/small_pkt_hdelay_test.sv" |
`include "small_pkt_hdelay_test/small_pkt_hdelay_test_seq.sv" |
|
`include "small_pkt_zdelay_test/small_pkt_zdelay_test.sv" |
`include "small_pkt_zdelay_test/small_pkt_zdelay_test_seq.sv" |
|
`include "init_test/init_test.sv" |
`include "init_test/init_test_seq.sv" |
|
`ifdef HMC_UVC |
`include "error_pkt_test/error_pkt_test.sv" |
`include "error_pkt_test/error_pkt_test_seq.sv" |
`include "bit_error_test/bit_error_test.sv" |
`include "bit_error_test/bit_error_test_seq.sv" |
`endif |
/common/testlib/small_pkt_zdelay_test/small_pkt_zdelay_test.sv
0,0 → 1,77
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// small_pkt_zdelay_test test |
// |
// |
|
// test description: |
// add a description of the test here |
|
|
`ifndef small_pkt_zdelay_test_SV |
`define small_pkt_zdelay_test_SV |
|
class small_pkt_zdelay_test extends hmc_base_test; |
|
`uvm_component_utils(small_pkt_zdelay_test) |
|
|
function new(string name = "small_pkt_zdelay_test", uvm_component parent = null); |
super.new(name,parent); |
endfunction : new |
|
|
virtual function void build_phase(uvm_phase phase); |
|
uvm_config_db#(uvm_object_wrapper)::set(this,"hmc_tb0.v_seqr.run_phase","default_sequence",small_pkt_zdelay_test_seq::type_id::get()); |
|
super.build_phase(phase); |
|
endfunction : build_phase |
|
task run_phase(uvm_phase phase); |
phase.phase_done.set_drain_time(this, 1us); |
endtask : run_phase |
|
endclass : small_pkt_zdelay_test |
|
`endif // small_pkt_zdelay_test_SV |
/common/testlib/small_pkt_zdelay_test/small_pkt_zdelay_test_seq.sv
0,0 → 1,83
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// small_pkt_zdelay_test sequence |
// |
// |
|
|
`ifndef small_pkt_zdelay_test_SEQ_SV |
`define small_pkt_zdelay_test_SEQ_SV |
|
class small_pkt_zdelay_test_seq extends hmc_base_seq; |
|
openhmc_init_seq init; |
hmc_model_init_seq bfm; |
openhmc_check_seq check; |
hmc_small_pkts_zdelay_seq work; |
|
function new(string name="small_pkt_zdelay_test_seq"); |
super.new(name); |
endfunction : new |
|
`uvm_object_utils(small_pkt_zdelay_test_seq) |
`uvm_declare_p_sequencer(vseqr) |
|
virtual task body(); |
|
`uvm_info(get_type_name(), "starting small_pkt_zdelay_test_seq", UVM_NONE) |
|
`uvm_do(bfm) |
#1us; |
`uvm_do(init) |
#1us; |
//-- write your test here |
`uvm_do(work) |
|
`uvm_do(check) |
#1us; |
`uvm_info(get_type_name(), "small_pkt_zdelay_test_seq done", UVM_NONE) |
|
endtask : body |
|
endclass : small_pkt_zdelay_test_seq |
|
`endif // small_pkt_zdelay_test_SEQ_SV |
/common/testlib/single_pkt_test/single_pkt_test.sv
0,0 → 1,73
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// single_pkt_test test |
// |
// |
|
`ifndef single_pkt_test_SV |
`define single_pkt_test_SV |
|
class single_pkt_test extends hmc_base_test; |
|
`uvm_component_utils(single_pkt_test) |
|
|
function new(string name = "single_pkt_test", uvm_component parent = null); |
super.new(name,parent); |
endfunction : new |
|
|
virtual function void build_phase(uvm_phase phase); |
|
uvm_config_db#(uvm_object_wrapper)::set(this,"hmc_tb0.v_seqr.run_phase","default_sequence",single_pkt_test_seq::type_id::get()); |
|
super.build_phase(phase); |
|
endfunction : build_phase |
|
task run_phase(uvm_phase phase); |
phase.phase_done.set_drain_time(this, 1us); |
endtask : run_phase |
|
endclass : single_pkt_test |
|
`endif // single_pkt_test_SV |
/common/testlib/single_pkt_test/single_pkt_test_seq.sv
0,0 → 1,83
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// simple_test sequence |
// |
// |
|
`ifndef single_pkt_test_seq_SV |
`define single_pkt_test_seq_SV |
|
class single_pkt_test_seq extends hmc_base_seq; |
|
function new(string name="single_pkt_test_seq"); |
super.new(name); |
endfunction : new |
|
openhmc_init_seq init; |
hmc_model_init_seq bfm; |
openhmc_check_seq check; |
hmc_base_pkt_seq work; |
|
`uvm_object_utils(single_pkt_test_seq) |
`uvm_declare_p_sequencer(vseqr) |
|
hmc_2_axi4_sequence #(.DATA_BYTES(`AXI4BYTES), .TUSER_WIDTH(`AXI4BYTES)) requests; |
|
virtual task body(); |
|
`uvm_info(get_type_name(), "starting single_pkt_test_seq", UVM_NONE) |
|
`uvm_do(bfm) |
#1us; |
`uvm_do(init) |
#1us; |
|
`uvm_do_with(work, {req_class == NON_POSTED;num_packets==1;}) |
|
`uvm_info(get_type_name(), "single_pkt_test_seq done", UVM_NONE) |
`uvm_do(check) |
|
endtask : body |
|
endclass : single_pkt_test_seq |
|
`endif // single_pkt_test_seq_SV |
/common/testlib/init_test/init_test_seq.sv
0,0 → 1,80
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// init_test sequence |
// |
// |
|
`ifndef init_test_SEQ_SV |
`define init_test_SEQ_SV |
|
class init_test_seq extends hmc_base_seq; |
|
function new(string name="init_test_seq"); |
super.new(name); |
endfunction : new |
|
openhmc_init_seq init; |
hmc_model_init_seq bfm; |
openhmc_check_seq check; |
|
`uvm_object_utils(init_test_seq) |
`uvm_declare_p_sequencer(vseqr) |
|
hmc_2_axi4_sequence #(.DATA_BYTES(`AXI4BYTES), .TUSER_WIDTH(`AXI4BYTES)) requests; |
|
virtual task body(); |
|
`uvm_info(get_type_name(), "starting init_test_seq", UVM_NONE) |
|
`uvm_do(bfm) |
#1us; |
`uvm_do(init) |
#1us; |
|
`uvm_info(get_type_name(), "init_test_seq done", UVM_NONE) |
`uvm_do(check) |
|
endtask : body |
|
endclass : init_test_seq |
|
`endif // init_test_SEQ_SV |
/common/testlib/init_test/init_test.sv
0,0 → 1,75
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// init_test test |
// |
// |
|
`ifndef init_test_SV |
`define init_test_SV |
|
class init_test extends hmc_base_test; |
|
`uvm_component_utils(init_test) |
|
|
function new(string name = "init_test", uvm_component parent = null); |
super.new(name,parent); |
endfunction : new |
|
|
virtual function void build_phase(uvm_phase phase); |
|
|
// set_type_override_by_type(hmc_req_packet::get_type(),hmc_req_posted_packet::get_type()); |
uvm_config_db#(uvm_object_wrapper)::set(this,"hmc_tb0.v_seqr.run_phase","default_sequence",init_test_seq::type_id::get()); |
|
super.build_phase(phase); |
|
endfunction : build_phase |
|
task run_phase(uvm_phase phase); |
phase.phase_done.set_drain_time(this, 1us); |
endtask : run_phase |
|
endclass : init_test |
|
`endif // init_test_SV |
/common/testlib/big_pkt_hdelay_test/big_pkt_hdelay_test_seq.sv
0,0 → 1,83
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// big_pkt_hdelay_test sequence |
// |
// |
|
|
`ifndef big_pkt_hdelay_test_SEQ_SV |
`define big_pkt_hdelay_test_SEQ_SV |
|
class big_pkt_hdelay_test_seq extends hmc_base_seq; |
|
openhmc_init_seq init; |
hmc_model_init_seq bfm; |
openhmc_check_seq check; |
hmc_big_pkts_hdelay_seq work; |
|
function new(string name="big_pkt_hdelay_test_seq"); |
super.new(name); |
endfunction : new |
|
`uvm_object_utils(big_pkt_hdelay_test_seq) |
`uvm_declare_p_sequencer(vseqr) |
|
virtual task body(); |
|
`uvm_info(get_type_name(), "starting big_pkt_hdelay_test_seq", UVM_NONE) |
|
`uvm_do(bfm) |
#1us; |
`uvm_do(init) |
#1us; |
//-- write your test here |
`uvm_do(work) |
|
`uvm_do(check) |
#1us; |
`uvm_info(get_type_name(), "big_pkt_hdelay_test_seq done", UVM_NONE) |
|
endtask : body |
|
endclass : big_pkt_hdelay_test_seq |
|
`endif // big_pkt_hdelay_test_SEQ_SV |
/common/testlib/big_pkt_hdelay_test/big_pkt_hdelay_test.sv
0,0 → 1,77
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// big_pkt_hdelay_test test |
// |
// |
|
// test description: |
// add a description of the test here |
|
|
`ifndef big_pkt_hdelay_test_SV |
`define big_pkt_hdelay_test_SV |
|
class big_pkt_hdelay_test extends hmc_base_test; |
|
`uvm_component_utils(big_pkt_hdelay_test) |
|
|
function new(string name = "big_pkt_hdelay_test", uvm_component parent = null); |
super.new(name,parent); |
endfunction : new |
|
|
virtual function void build_phase(uvm_phase phase); |
|
uvm_config_db#(uvm_object_wrapper)::set(this,"hmc_tb0.v_seqr.run_phase","default_sequence",big_pkt_hdelay_test_seq::type_id::get()); |
|
super.build_phase(phase); |
|
endfunction : build_phase |
|
task run_phase(uvm_phase phase); |
phase.phase_done.set_drain_time(this, 1us); |
endtask : run_phase |
|
endclass : big_pkt_hdelay_test |
|
`endif // big_pkt_hdelay_test_SV |
/common/testlib/error_pkt_test/error_pkt_test_seq.sv
0,0 → 1,94
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// error_pkt_test sequence |
// |
// |
|
`ifndef error_pkt_test_SEQ_SV |
`define error_pkt_test_SEQ_SV |
|
class error_pkt_test_seq extends hmc_base_seq; |
|
rand int iterations; |
|
constraint iterations_c { |
iterations >= 1; |
iterations <= 20; |
} |
|
function new(string name="error_pkt_test_seq"); |
super.new(name); |
endfunction : new |
|
openhmc_init_seq init; |
hmc_model_init_seq bfm; |
openhmc_check_seq check; |
hmc_base_pkt_seq work; |
|
`uvm_object_utils(error_pkt_test_seq) |
`uvm_declare_p_sequencer(vseqr) |
|
hmc_2_axi4_sequence #(.DATA_BYTES(`AXI4BYTES), .TUSER_WIDTH(`AXI4BYTES)) requests; |
|
virtual task body(); |
|
`uvm_info(get_type_name(), "starting error_pkt_test_seq", UVM_NONE) |
|
`uvm_do(bfm) |
#1us; |
`uvm_do(init) |
#1us; |
|
repeat (iterations) |
randcase |
1 : `uvm_do_with(work, {req_class == NON_POSTED;}) |
1 : `uvm_do_with(work, {req_class == POSTED;}) |
endcase |
|
`uvm_info(get_type_name(), "error_pkt_test_seq done", UVM_NONE) |
`uvm_do(check) |
|
endtask : body |
|
endclass : error_pkt_test_seq |
|
`endif // error_pkt_test_SEQ_SV |
/common/testlib/error_pkt_test/error_pkt_test.sv
0,0 → 1,78
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// error_pkt_test test |
// |
// |
|
`ifndef error_pkt_test_SV |
`define error_pkt_test_SV |
|
class error_pkt_test extends hmc_base_test; |
|
`uvm_component_utils(error_pkt_test) |
|
|
function new(string name = "error_pkt_test", uvm_component parent = null); |
super.new(name,parent); |
endfunction : new |
|
|
virtual function void build_phase(uvm_phase phase); |
|
uvm_config_db#(uvm_object_wrapper)::set(this,"hmc_tb0.v_seqr.run_phase","default_sequence",error_pkt_test_seq::type_id::get()); |
super.build_phase(phase); |
link_cfg.requester.errors_enabled = 1; |
link_cfg.responder.errors_enabled = 1; |
|
link_cfg.requester.lane_errors_enabled = 0; |
link_cfg.responder.lane_errors_enabled = 0; |
|
link_cfg_randomize : assert (link_cfg.randomize()); |
endfunction : build_phase |
|
task run_phase(uvm_phase phase); |
phase.phase_done.set_drain_time(this, 1us); |
endtask : run_phase |
|
endclass : error_pkt_test |
|
`endif // error_pkt_test_SV |
/common/testlib/zero_delay_pkt_test/zero_delay_pkt_test.sv
0,0 → 1,77
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// zero_delay_pkt_test test |
// |
// |
|
// test description: |
// add a description of the test here |
|
|
`ifndef zero_delay_pkt_test_SV |
`define zero_delay_pkt_test_SV |
|
class zero_delay_pkt_test extends hmc_base_test; |
|
`uvm_component_utils(zero_delay_pkt_test) |
|
|
function new(string name = "zero_delay_pkt_test", uvm_component parent = null); |
super.new(name,parent); |
endfunction : new |
|
|
virtual function void build_phase(uvm_phase phase); |
|
uvm_config_db#(uvm_object_wrapper)::set(this,"hmc_tb0.v_seqr.run_phase","default_sequence",zero_delay_pkt_test_seq::type_id::get()); |
|
super.build_phase(phase); |
|
endfunction : build_phase |
|
task run_phase(uvm_phase phase); |
phase.phase_done.set_drain_time(this, 1us); |
endtask : run_phase |
|
endclass : zero_delay_pkt_test |
|
`endif // zero_delay_pkt_test_SV |
/common/testlib/zero_delay_pkt_test/zero_delay_pkt_test_seq.sv
0,0 → 1,83
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// zero_delay_pkt_test sequence |
// |
// |
|
|
`ifndef zero_delay_pkt_test_SEQ_SV |
`define zero_delay_pkt_test_SEQ_SV |
|
class zero_delay_pkt_test_seq extends hmc_base_seq; |
|
openhmc_init_seq init; |
hmc_model_init_seq bfm; |
openhmc_check_seq check; |
hmc_zdelay_seq work; |
|
function new(string name="zero_delay_pkt_test_seq"); |
super.new(name); |
endfunction : new |
|
`uvm_object_utils(zero_delay_pkt_test_seq) |
`uvm_declare_p_sequencer(vseqr) |
|
virtual task body(); |
|
`uvm_info(get_type_name(), "starting zero_delay_pkt_test_seq", UVM_NONE) |
|
`uvm_do(bfm) |
#1us; |
`uvm_do(init) |
#1us; |
//-- write your test here |
`uvm_do(work) |
|
`uvm_do(check) |
#1us; |
`uvm_info(get_type_name(), "zero_delay_pkt_test_seq done", UVM_NONE) |
|
endtask : body |
|
endclass : zero_delay_pkt_test_seq |
|
`endif // zero_delay_pkt_test_SEQ_SV |
/common/testlib/high_delay_pkt_test/high_delay_pkt_test.sv
0,0 → 1,77
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// high_delay_pkt_test test |
// |
// |
|
// test description: |
// add a description of the test here |
|
|
`ifndef high_delay_pkt_test_SV |
`define high_delay_pkt_test_SV |
|
class high_delay_pkt_test extends hmc_base_test; |
|
`uvm_component_utils(high_delay_pkt_test) |
|
|
function new(string name = "high_delay_pkt_test", uvm_component parent = null); |
super.new(name,parent); |
endfunction : new |
|
|
virtual function void build_phase(uvm_phase phase); |
|
uvm_config_db#(uvm_object_wrapper)::set(this,"hmc_tb0.v_seqr.run_phase","default_sequence",high_delay_pkt_test_seq::type_id::get()); |
|
super.build_phase(phase); |
|
endfunction : build_phase |
|
task run_phase(uvm_phase phase); |
phase.phase_done.set_drain_time(this, 1us); |
endtask : run_phase |
|
endclass : high_delay_pkt_test |
|
`endif // high_delay_pkt_test_SV |
/common/testlib/high_delay_pkt_test/high_delay_pkt_test_seq.sv
0,0 → 1,83
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// high_delay_pkt_test sequence |
// |
// |
|
|
`ifndef high_delay_pkt_test_SEQ_SV |
`define high_delay_pkt_test_SEQ_SV |
|
class high_delay_pkt_test_seq extends hmc_base_seq; |
|
openhmc_init_seq init; |
hmc_model_init_seq bfm; |
openhmc_check_seq check; |
hmc_hdelay_seq work; |
|
function new(string name="high_delay_pkt_test_seq"); |
super.new(name); |
endfunction : new |
|
`uvm_object_utils(high_delay_pkt_test_seq) |
`uvm_declare_p_sequencer(vseqr) |
|
virtual task body(); |
|
`uvm_info(get_type_name(), "starting high_delay_pkt_test_seq", UVM_NONE) |
|
`uvm_do(bfm) |
#1us; |
`uvm_do(init) |
#1us; |
//-- write your test here |
`uvm_do(work) |
|
`uvm_do(check) |
#1us; |
`uvm_info(get_type_name(), "high_delay_pkt_test_seq done", UVM_NONE) |
|
endtask : body |
|
endclass : high_delay_pkt_test_seq |
|
`endif // high_delay_pkt_test_SEQ_SV |
/common/testlib/small_pkt_hdelay_test/small_pkt_hdelay_test.sv
0,0 → 1,77
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// small_pkt_hdelay_test test |
// |
// |
|
// test description: |
// add a description of the test here |
|
|
`ifndef small_pkt_hdelay_test_SV |
`define small_pkt_hdelay_test_SV |
|
class small_pkt_hdelay_test extends hmc_base_test; |
|
`uvm_component_utils(small_pkt_hdelay_test) |
|
|
function new(string name = "small_pkt_hdelay_test", uvm_component parent = null); |
super.new(name,parent); |
endfunction : new |
|
|
virtual function void build_phase(uvm_phase phase); |
|
uvm_config_db#(uvm_object_wrapper)::set(this,"hmc_tb0.v_seqr.run_phase","default_sequence",small_pkt_hdelay_test_seq::type_id::get()); |
|
super.build_phase(phase); |
|
endfunction : build_phase |
|
task run_phase(uvm_phase phase); |
phase.phase_done.set_drain_time(this, 1us); |
endtask : run_phase |
|
endclass : small_pkt_hdelay_test |
|
`endif // small_pkt_hdelay_test_SV |
/common/testlib/small_pkt_hdelay_test/small_pkt_hdelay_test_seq.sv
0,0 → 1,84
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// small_pkt_hdelay_test sequence |
// |
// |
|
|
`ifndef small_pkt_hdelay_test_SEQ_SV |
`define small_pkt_hdelay_test_SEQ_SV |
|
class small_pkt_hdelay_test_seq extends hmc_base_seq; |
|
openhmc_init_seq init; |
hmc_model_init_seq bfm; |
openhmc_check_seq check; |
hmc_small_pkts_hdelay_seq work; |
|
function new(string name="small_pkt_hdelay_test_seq"); |
super.new(name); |
endfunction : new |
|
`uvm_object_utils(small_pkt_hdelay_test_seq) |
`uvm_declare_p_sequencer(vseqr) |
|
virtual task body(); |
|
`uvm_info(get_type_name(), "starting small_pkt_hdelay_test_seq", UVM_NONE) |
|
`uvm_do(bfm) |
#1us; |
`uvm_do(init) |
#1us; |
//-- write your test here |
`uvm_do(work) |
|
`uvm_do(check) |
|
#1us; |
`uvm_info(get_type_name(), "small_pkt_hdelay_test_seq done", UVM_NONE) |
|
endtask : body |
|
endclass : small_pkt_hdelay_test_seq |
|
`endif // small_pkt_hdelay_test_SEQ_SV |
/common/testlib/sleep_mode_test/sleep_mode_test.sv
0,0 → 1,73
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// slep_mode_test test |
// |
// |
|
`ifndef slep_mode_test_SV |
`define slep_mode_test_SV |
|
class sleep_mode_test extends hmc_base_test; |
|
`uvm_component_utils(sleep_mode_test) |
|
|
function new(string name = "sleep_mode_test", uvm_component parent = null); |
super.new(name,parent); |
endfunction : new |
|
|
virtual function void build_phase(uvm_phase phase); |
|
uvm_config_db#(uvm_object_wrapper)::set(this,"hmc_tb0.v_seqr.run_phase","default_sequence",sleep_mode_test_seq::type_id::get()); |
|
super.build_phase(phase); |
|
endfunction : build_phase |
|
task run_phase(uvm_phase phase); |
phase.phase_done.set_drain_time(this, 1us); |
endtask : run_phase |
|
endclass : sleep_mode_test |
|
`endif // slep_mode_test_SV |
/common/testlib/sleep_mode_test/sleep_mode_test_seq.sv
0,0 → 1,170
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// sleep_mode_test sequence |
// |
// |
|
`ifndef sleep_mode_test_SEQ_SV |
`define sleep_mode_test_SEQ_SV |
|
class sleep_mode_test_seq extends hmc_base_seq; |
|
rand int iterations; |
|
constraint iterations_c { |
iterations >= 1; |
iterations <= 10; |
} |
|
function new(string name="sleep_mode_test_seq"); |
super.new(name); |
endfunction : new |
|
|
openhmc_init_seq init; |
hmc_model_init_seq bfm; |
openhmc_check_seq check; |
hmc_base_pkt_seq work; |
|
reg_openhmc_rf_status_general_c status; |
reg_openhmc_rf_control_c control; |
reg_openhmc_rf_sent_np_c sent_np; |
reg_openhmc_rf_rcvd_rsp_c rcvd_rsp; |
|
`uvm_object_utils(sleep_mode_test_seq) |
`uvm_declare_p_sequencer(vseqr) |
|
hmc_2_axi4_sequence #(.DATA_BYTES(`AXI4BYTES), .TUSER_WIDTH(`AXI4BYTES)) requests; |
int timer; |
|
task wait_for_idle (); |
timer = 0; |
p_sequencer.rf_seqr_hmc.read_reg(status); |
p_sequencer.rf_seqr_hmc.read_reg(sent_np); |
p_sequencer.rf_seqr_hmc.read_reg(rcvd_rsp); |
p_sequencer.rf_seqr_hmc.read_reg(control); |
#1us; |
|
while( ((sent_np.fields.cnt_ != rcvd_rsp.fields.cnt_) || |
(status.fields.hmc_tokens_remaining_ != p_sequencer.link_cfg.hmc_tokens) || |
(status.fields.rx_tokens_remaining_ != p_sequencer.link_cfg.rx_tokens)) |
&& |
(timer < 200)) begin |
#1us; |
p_sequencer.rf_seqr_hmc.read_reg(status); |
p_sequencer.rf_seqr_hmc.read_reg(sent_np); |
p_sequencer.rf_seqr_hmc.read_reg(rcvd_rsp); |
`uvm_info(get_type_name(),$psprintf("RX token count in TX_LINK = %0d, should be %0d" , status.fields.rx_tokens_remaining_ , p_sequencer.link_cfg.rx_tokens),UVM_LOW) |
`uvm_info(get_type_name(),$psprintf("HMC token count in TX_LINK = %0d, should be %0d", status.fields.hmc_tokens_remaining_, p_sequencer.link_cfg.hmc_tokens),UVM_LOW) |
`uvm_info(get_type_name(),$psprintf("sent = %0d non-posted packets, received %0d responses", sent_np.fields.cnt_, rcvd_rsp.fields.cnt_),UVM_LOW) |
timer++; |
end |
#3us; |
endtask |
|
|
virtual task body(); |
time sleep_time = 10us; |
|
`uvm_info(get_type_name(), "starting sleep_mode_test_seq", UVM_NONE) |
|
//initiate all the registers |
$cast(status,p_sequencer.rf_seqr_hmc.get_by_name("status_general")); |
status.set_check_on_read(1'b0); |
|
$cast(control,p_sequencer.rf_seqr_hmc.get_by_name("control")); |
control.set_check_on_read(1'b0); |
|
$cast(sent_np,p_sequencer.rf_seqr_hmc.get_by_name("sent_np")); |
sent_np.set_check_on_read(1'b0); |
|
$cast(rcvd_rsp,p_sequencer.rf_seqr_hmc.get_by_name("rcvd_rsp")); |
rcvd_rsp.set_check_on_read(1'b0); |
|
//-- write your test here |
`uvm_do(bfm) |
|
#1us; |
`uvm_do(init) |
#1us; |
|
repeat (iterations) begin |
repeat(5) begin |
randcase |
1 : `uvm_do_with(work, {req_class == NON_POSTED;}) |
1 : `uvm_do_with(work, {req_class == POSTED;}) |
endcase |
end |
//Sleep Mode entry and exit |
`uvm_info(get_type_name(),$psprintf("SLEEP MODE: WAIT FOR IDLE"),UVM_LOW) |
wait_for_idle(); |
`uvm_info(get_type_name(),$psprintf("SLEEP MODE: SET"),UVM_LOW) |
//Set the sleep_mode_test bit within the Register File |
control.fields.set_hmc_sleep_ = 1; |
p_sequencer.rf_seqr_hmc.write_reg(control); |
p_sequencer.rf_seqr_hmc.read_reg(status); |
#1us; |
while(!status.fields.sleep_mode_) begin |
p_sequencer.rf_seqr_hmc.read_reg(status); |
end |
//Stay in Sleep for up to 22 us |
sleep_time_rand_succeeds : assert (std::randomize(sleep_time) |
with {sleep_time >= 2us && sleep_time < 22us;}); //-- should be 1ms in real system |
#(sleep_time); |
`uvm_info(get_type_name(),$psprintf("SLEEP MODE: EXIT"),UVM_LOW) |
//Force openHMC controller to exit sleep mode |
control.fields.set_hmc_sleep_ = 0; |
p_sequencer.rf_seqr_hmc.write_reg(control); |
while(!status.fields.link_up_) begin |
p_sequencer.rf_seqr_hmc.read_reg(status); |
end |
end |
|
#1us; |
`uvm_info(get_type_name(), "sleep_mode_test_seq done", UVM_NONE) |
`uvm_do(check) |
|
endtask : body |
|
endclass : sleep_mode_test_seq |
|
`endif // sleep_mode_test_SEQ_SV |
/common/testlib/posted_pkt_test/posted_pkt_test.sv
0,0 → 1,77
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// posted_pkt_test test |
// |
// |
|
// test description: |
// add a description of the test here |
|
|
`ifndef posted_pkt_test_SV |
`define posted_pkt_test_SV |
|
class posted_pkt_test extends hmc_base_test; |
|
`uvm_component_utils(posted_pkt_test) |
|
|
function new(string name = "posted_pkt_test", uvm_component parent = null); |
super.new(name,parent); |
endfunction : new |
|
|
virtual function void build_phase(uvm_phase phase); |
|
uvm_config_db#(uvm_object_wrapper)::set(this,"hmc_tb0.v_seqr.run_phase","default_sequence",posted_pkt_test_seq::type_id::get()); |
|
super.build_phase(phase); |
|
endfunction : build_phase |
|
task run_phase(uvm_phase phase); |
phase.phase_done.set_drain_time(this, 1us); |
endtask : run_phase |
|
endclass : posted_pkt_test |
|
`endif // posted_pkt_test_SV |
/common/testlib/posted_pkt_test/posted_pkt_test_seq.sv
0,0 → 1,110
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// posted_pkt_test sequence |
// |
// |
|
|
`ifndef posted_pkt_test_SEQ_SV |
`define posted_pkt_test_SEQ_SV |
|
class posted_pkt_test_seq extends hmc_base_seq; |
|
rand int iterations; |
|
constraint iterations_c { |
iterations >= 1; |
iterations <= 10; |
} |
|
openhmc_init_seq init; |
hmc_model_init_seq bfm; |
openhmc_check_seq check; |
hmc_base_pkt_seq work; |
|
hmc_big_pkts_seq b_pkt; |
hmc_small_pkts_seq s_pkt; |
|
hmc_big_pkts_hdelay_seq b_h_pkt; |
hmc_big_pkts_zdelay_seq b_z_pkt; |
hmc_small_pkts_hdelay_seq s_h_pkt; |
hmc_small_pkts_zdelay_seq s_z_pkt; |
|
function new(string name="posted_pkt_test_seq"); |
super.new(name); |
endfunction : new |
|
`uvm_object_utils(posted_pkt_test_seq) |
`uvm_declare_p_sequencer(vseqr) |
|
virtual task body(); |
|
`uvm_info(get_type_name(), "starting posted_pkt_test_seq", UVM_NONE) |
|
//-- write your test here |
|
`uvm_do(bfm) |
#1us; |
`uvm_do(init) |
#1us; |
repeat(iterations) |
randcase |
1 : `uvm_do_with( work,{req_class == POSTED;}) |
1 : `uvm_do_with( b_pkt,{req_class == POSTED;}) |
1 : `uvm_do_with( s_pkt,{req_class == POSTED;}) |
1 : `uvm_do_with(b_h_pkt,{req_class == POSTED;}) |
1 : `uvm_do_with(s_h_pkt,{req_class == POSTED;}) |
1 : `uvm_do_with(b_z_pkt,{req_class == POSTED;}) |
1 : `uvm_do_with(s_z_pkt,{req_class == POSTED;}) |
endcase |
|
#1us |
`uvm_do(check) |
|
#1us; |
`uvm_info(get_type_name(), "posted_pkt_test_seq done", UVM_NONE) |
|
endtask : body |
|
endclass : posted_pkt_test_seq |
|
`endif // posted_pkt_test_SEQ_SV |
/common/testlib/seq_lib/hmc_small_pkts_seq.sv
0,0 → 1,50
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
class hmc_small_pkts_seq extends hmc_base_pkt_seq; |
|
constraint p_length_c { |
max_packet_length == 2; |
} |
`uvm_object_utils(hmc_small_pkts_seq) |
|
function new(string name="hmc_small_pkts_seq"); |
super.new(name); |
endfunction : new |
|
endclass : hmc_small_pkts_seq |
/common/testlib/seq_lib/hmc_big_pkts_zdelay_seq.sv
0,0 → 1,63
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
`ifndef HMC_BIG_PKTS_ZDELAY |
`define HMC_BIG_PKTS_ZDELAY |
|
class hmc_big_pkts_zdelay_seq extends hmc_base_pkt_seq; |
|
hmc_big_pkts_seq seq; |
|
|
constraint mx_delay_c { |
max_flit_delay == 0; |
} |
|
constraint big_pkts_c { |
min_packet_length == 6; |
} |
|
`uvm_object_utils(hmc_big_pkts_zdelay_seq) |
|
function new(string name="hmc_big_pkts_zdelay_seq"); |
super.new(name); |
endfunction : new |
|
endclass : hmc_big_pkts_zdelay_seq |
|
`endif |
/common/testlib/seq_lib/hmc_single_pkt_cycle_seq.sv
0,0 → 1,57
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
`ifndef SINGLE_PKT_CYCLE_SEQ |
`define SINGLE_PKT_CYCLE_SEQ |
|
class hmc_single_pkt_cycle_seq extends hmc_base_pkt_seq; |
|
constraint pkts_per_req_c{ |
pkts_per_req == 1; |
} |
|
`uvm_object_utils(hmc_single_pkt_cycle_seq) |
|
function new(string name="hmc_single_pkt_cycle_seq"); |
super.new(name); |
endfunction : new |
|
endclass : hmc_single_pkt_cycle_seq |
|
|
`endif |
/common/testlib/seq_lib/hmc_small_pkts_hdelay_seq.sv
0,0 → 1,62
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
`ifndef SMALL_PKTS_HDELAY_SEQ |
`define SMALL_PKTS_HDELAY_SEQ |
|
class hmc_small_pkts_hdelay_seq extends hmc_small_pkts_seq; |
|
constraint high_delay { |
min_flit_delay >= 90; |
max_flit_delay <= 200; |
} |
|
constraint small_pkts_c { |
max_packet_length == 2; |
} |
|
`uvm_object_utils(hmc_small_pkts_hdelay_seq) |
|
function new(string name="hmc_small_pkts_hdelay_seq"); |
super.new(name); |
endfunction : new |
|
endclass : hmc_small_pkts_hdelay_seq |
|
|
`endif //SMALL_PKTS_HDELAY_SEQ |
/common/testlib/seq_lib/hmc_small_pkts_zdelay_seq.sv
0,0 → 1,56
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
class hmc_small_pkts_zdelay_seq extends hmc_base_pkt_seq; |
|
hmc_small_pkts_seq seq; |
|
constraint mx_delay_c { |
max_flit_delay == 0; |
} |
|
constraint small_pkts_c { |
max_packet_length == 2; |
} |
`uvm_object_utils(hmc_small_pkts_zdelay_seq) |
|
function new(string name="hmc_small_pkts_zdelay_seq"); |
super.new(name); |
endfunction : new |
|
endclass : hmc_small_pkts_zdelay_seq |
/common/testlib/seq_lib/hmc_big_pkts_seq.sv
0,0 → 1,51
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
class hmc_big_pkts_seq extends hmc_base_pkt_seq; |
|
|
constraint min_max_length_c { |
min_packet_length >= 6; |
} |
|
`uvm_object_utils(hmc_big_pkts_seq) |
|
function new(string name="hmc_big_pkts_seq"); |
super.new(name); |
endfunction : new |
endclass : hmc_big_pkts_seq |
/common/testlib/seq_lib/hmc_hdelay_seq.sv
0,0 → 1,51
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
class hmc_hdelay_seq extends hmc_base_pkt_seq; |
|
constraint p_delay_c { |
min_flit_delay == 90; |
max_flit_delay == 200; |
} |
|
`uvm_object_utils(hmc_hdelay_seq) |
|
function new(string name="hmc_hdelay_seq"); |
super.new(name); |
endfunction : new |
endclass : hmc_hdelay_seq |
/common/testlib/seq_lib/hmc_seq_lib.sv
0,0 → 1,57
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
`ifndef HMC_PACKET_SEQ_LIB |
`define HMC_PACKET_SEQ_LIB |
|
|
`include "seq_lib/hmc_base_pkt_seq.sv" |
`include "seq_lib/hmc_small_pkts_seq.sv" |
`include "seq_lib/hmc_big_pkts_seq.sv" |
`include "seq_lib/hmc_hdelay_seq.sv" |
`include "seq_lib/hmc_zdelay_seq.sv" |
|
`include "seq_lib/hmc_big_pkts_zdelay_seq.sv" |
`include "seq_lib/hmc_small_pkts_zdelay_seq.sv" |
|
`include "seq_lib/hmc_big_pkts_hdelay_seq.sv" |
`include "seq_lib/hmc_small_pkts_hdelay_seq.sv" |
|
`include "seq_lib/hmc_single_pkt_cycle_seq.sv" |
|
`endif |
/common/testlib/seq_lib/hmc_base_pkt_seq.sv
0,0 → 1,189
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
`ifndef HMC_BASE_PKT_SEQ |
`define HMC_BASE_PKT_SEQ |
|
typedef enum { |
POSTED, |
ATOMIC, |
NON_POSTED, |
ALL_TYPES |
// MISC |
} request_class_e; |
|
class hmc_base_pkt_seq extends hmc_base_seq; |
|
|
|
rand int num_packets ; |
rand int pkts_per_req; |
|
|
rand request_class_e req_class; |
|
//-- delay constraints |
rand int min_flit_delay ; |
rand int max_flit_delay ; |
|
rand int min_packet_length ; |
rand int max_packet_length ; |
|
|
|
constraint delay_c { |
!(min_flit_delay > max_flit_delay); |
min_flit_delay >= 0; |
soft max_flit_delay <= 50; |
} |
|
constraint pkt_length_c { |
min_packet_length <= max_packet_length; |
min_packet_length >= 0; |
max_packet_length <= 9; |
} |
|
constraint num_packets_c { |
num_packets > 0; |
soft num_packets <= 50; |
} |
|
constraint pkts_per_req_c { |
pkts_per_req > 0; |
soft pkts_per_req <= 10; |
pkts_per_req <= num_packets; |
} |
|
`uvm_object_utils(hmc_base_pkt_seq) |
`uvm_declare_p_sequencer(vseqr) |
|
hmc_2_axi4_sequence #(.DATA_BYTES(`AXI4BYTES), .TUSER_WIDTH(`AXI4BYTES)) requests; |
|
function new(string name="hmc_base_pkt_seq"); |
super.new(name); |
endfunction : new |
|
virtual task body(); |
`uvm_info(get_type_name(), "starting...", UVM_HIGH) |
|
while (num_packets > 0) begin |
`uvm_create_on(requests, p_sequencer.axi4_req_seqr) |
if(req_class == POSTED) |
`uvm_info(get_type_name(),$psprintf("sending posted requests"), UVM_MEDIUM) |
else if (req_class == NON_POSTED) |
`uvm_info(get_type_name(),$psprintf("sending non_posted requests"), UVM_MEDIUM) |
else if (req_class == ATOMIC) |
`uvm_info(get_type_name(),$psprintf("sending atomic requests"), UVM_MEDIUM) |
else if (req_class == ALL) |
`uvm_info(get_type_name(),$psprintf("sending all requests"), UVM_MEDIUM) |
requests.num_packets = pkts_per_req; |
void'(requests.randomize() with { |
foreach(requests.hmc_items[i]) { |
requests.hmc_items[i].flit_delay inside {[min_flit_delay:max_flit_delay]}; |
soft requests.hmc_items[i].packet_length inside {[min_packet_length:max_packet_length]}; |
if(req_class == POSTED) { |
requests.hmc_items[i].command inside { |
HMC_POSTED_WRITE_16, |
HMC_POSTED_WRITE_32, |
HMC_POSTED_WRITE_48, |
HMC_POSTED_WRITE_64, |
HMC_POSTED_WRITE_80, |
HMC_POSTED_WRITE_96, |
HMC_POSTED_WRITE_112, |
HMC_POSTED_WRITE_128, |
HMC_POSTED_BIT_WRIT |
}; |
} |
if(req_class == NON_POSTED) { |
requests.hmc_items[i].command inside { |
HMC_WRITE_16, |
HMC_WRITE_32, |
HMC_WRITE_48, |
HMC_WRITE_64, |
HMC_WRITE_80, |
HMC_WRITE_96, |
HMC_WRITE_112, |
HMC_WRITE_128, |
|
HMC_MODE_READ, |
HMC_READ_16, |
HMC_READ_32, |
HMC_READ_48, |
HMC_READ_64, |
HMC_READ_80, |
HMC_READ_96, |
HMC_READ_112, |
HMC_READ_128}; |
} |
if(req_class == ATOMIC) { |
requests.hmc_items[i].command inside { |
//HMC_MODE_WRITE, |
HMC_BIT_WRITE, |
HMC_DUAL_8B_ADDI, |
HMC_SINGLE_16B_ADDI, |
HMC_POSTED_BIT_WRIT, |
|
HMC_POSTED_BIT_WRIT, |
HMC_POSTED_DUAL_8B_ADDI, |
HMC_POSTED_SINGLE_16B_ADDI |
|
// HMC_MODE_READ |
}; |
} |
// if(req_class == MISC) { |
// requests.hmc_items[i].command inside { |
// // //HMC_MODE_WRITE |
// HMC_MODE_READ}; |
// } |
|
|
|
} |
}); |
num_packets -= pkts_per_req; |
`uvm_info(get_type_name(),$psprintf("Packets sent!"), UVM_MEDIUM) |
|
`uvm_send(requests) |
end |
|
endtask : body |
|
endclass : hmc_base_pkt_seq |
|
|
`endif |
/common/testlib/seq_lib/hmc_zdelay_seq.sv
0,0 → 1,51
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
class hmc_zdelay_seq extends hmc_base_pkt_seq; |
|
constraint zdelay { |
max_flit_delay == 0; |
} |
|
`uvm_object_utils(hmc_zdelay_seq) |
|
function new(string name="hmc_zdelay_seq"); |
super.new(name); |
endfunction : new |
|
endclass : hmc_zdelay_seq |
/common/testlib/seq_lib/hmc_big_pkts_hdelay_seq.sv
0,0 → 1,64
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
`ifndef BIG_PKTS_HDELAY_SEQ |
`define BIG_PKTS_HDELAY_SEQ |
|
class hmc_big_pkts_hdelay_seq extends hmc_big_pkts_seq; |
|
constraint high_delay { |
min_flit_delay >= 90; |
max_flit_delay <= 200; |
} |
constraint big_pkts_c { |
min_packet_length == 6; |
} |
|
|
|
`uvm_object_utils(hmc_big_pkts_hdelay_seq) |
|
function new(string name="hmc_big_pkts_hdelay_seq"); |
super.new(name); |
endfunction : new |
|
|
endclass : hmc_big_pkts_hdelay_seq |
|
|
`endif // BIG_PKTS_HDELAY_SEQ |
/common/testlib/big_pkt_test/big_pkt_test.sv
0,0 → 1,77
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// big_pkt_test test |
// |
// |
|
// test description: |
// add a description of the test here |
|
|
`ifndef big_pkt_test_SV |
`define big_pkt_test_SV |
|
class big_pkt_test extends hmc_base_test; |
|
`uvm_component_utils(big_pkt_test) |
|
|
function new(string name = "big_pkt_test", uvm_component parent = null); |
super.new(name,parent); |
endfunction : new |
|
|
virtual function void build_phase(uvm_phase phase); |
|
uvm_config_db#(uvm_object_wrapper)::set(this,"hmc_tb0.v_seqr.run_phase","default_sequence",big_pkt_test_seq::type_id::get()); |
|
super.build_phase(phase); |
|
endfunction : build_phase |
|
task run_phase(uvm_phase phase); |
phase.phase_done.set_drain_time(this, 1us); |
endtask : run_phase |
|
endclass : big_pkt_test |
|
`endif // big_pkt_test_SV |
/common/testlib/big_pkt_test/big_pkt_test_seq.sv
0,0 → 1,83
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// big_pkt_test sequence |
// |
// |
|
|
`ifndef big_pkt_test_SEQ_SV |
`define big_pkt_test_SEQ_SV |
|
class big_pkt_test_seq extends hmc_base_seq; |
|
openhmc_init_seq init; |
hmc_model_init_seq bfm; |
openhmc_check_seq check; |
hmc_big_pkts_seq work; |
|
function new(string name="big_pkt_test_seq"); |
super.new(name); |
endfunction : new |
|
`uvm_object_utils(big_pkt_test_seq) |
`uvm_declare_p_sequencer(vseqr) |
|
virtual task body(); |
|
`uvm_info(get_type_name(), "starting big_pkt_test_seq", UVM_NONE) |
|
`uvm_do(bfm) |
#1us; |
`uvm_do(init) |
#1us; |
//-- write your test here |
`uvm_do(work) |
|
`uvm_do(check) |
#1us; |
`uvm_info(get_type_name(), "big_pkt_test_seq done", UVM_NONE) |
|
endtask : body |
|
endclass : big_pkt_test_seq |
|
`endif // big_pkt_test_SEQ_SV |
/common/src/tag_handler.sv
0,0 → 1,178
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// tag handler |
// |
// |
|
`ifndef TAG_HANDLER_SV |
`define TAG_HANDLER_SV |
|
class tag_handler extends uvm_component; |
|
int tag_count = 512; //-- tags available at the beginning |
bit tags_in_use[]; //-- bitmap of current used tags |
int tag_fifo[$]; |
int transaction_count; |
int max_tags_in_use; |
int num_tags_in_use; |
int used_tag; |
|
event tag_avail_event; |
|
covergroup tags_used_cg; |
TAGS_USED : coverpoint used_tag{ |
bins valid_tags [] = {[0:tag_count-1]}; |
bins illegal_tags = {[tag_count:$]}; |
} |
endgroup |
|
`uvm_analysis_imp_decl(_hmc_rsp) |
uvm_analysis_imp_hmc_rsp #(hmc_packet, tag_handler) hmc_rsp_port; |
|
`uvm_component_utils_begin(tag_handler) |
`uvm_field_int(tag_count, UVM_DEFAULT) |
`uvm_component_utils_end |
|
function new ( string name="tag_handler", uvm_component parent ); |
super.new(name, parent); |
tags_used_cg = new(); |
endfunction : new |
|
function void build_phase(uvm_phase phase); |
hmc_rsp_port = new("hmc_rsp_port",this); |
|
tags_in_use = new [tag_count]; |
|
max_tags_in_use = 0; |
transaction_count = 0; |
reset(); |
endfunction : build_phase |
|
function void reset(); |
|
foreach (tags_in_use[i]) begin |
tags_in_use[i] =0; |
end |
|
num_tags_in_use = 0; |
tag_fifo = {}; |
|
for (int i=0; i< tag_count; i++) |
tag_fifo.push_back(tag_count-1-i); |
endfunction : reset |
|
task get_tag(ref int tag ); |
//-- wait until at least 1 tag available |
if (tag_fifo.size() == 0) begin |
`uvm_info(get_type_name(), $psprintf("get_tag: no tags available...waiting"), UVM_HIGH) |
@(tag_avail_event); |
`uvm_info(get_type_name(), $psprintf("get_tag: one tag is now available"), UVM_HIGH) |
end |
|
//-- flag tag as used |
tag = tag_fifo.pop_front(); |
tags_in_use[tag] = 1'b1; |
used_tag = tag; |
tags_used_cg.sample(); |
|
num_tags_in_use++; |
if (num_tags_in_use > max_tags_in_use) |
max_tags_in_use = num_tags_in_use; |
endtask : get_tag |
|
task try_get_tag(ref int tag ); |
//-- wait until at least 1 tag available |
if (tag_fifo.size() == 0) begin |
`uvm_info(get_type_name(), $psprintf("get_tag: no tags available...returning NULL"), UVM_HIGH) |
tag = -1; |
end else begin |
|
//-- flag tag as used |
tag = tag_fifo.pop_front(); |
tags_in_use[tag] = 1'b1; |
used_tag = tag; |
tags_used_cg.sample(); |
|
num_tags_in_use++; |
if (num_tags_in_use > max_tags_in_use) |
max_tags_in_use = num_tags_in_use; |
end |
endtask : try_get_tag |
|
function void release_tag(input int tag); |
if (!tags_in_use[tag]) |
`uvm_fatal(get_type_name(), $psprintf("release_tag: tag (%0d) not in use!", tag)) |
//-- release tag |
tags_in_use[tag] = 1'b0; |
num_tags_in_use--; |
transaction_count++; |
tag_fifo.push_back(tag); |
|
//-- signal that tag is available |
-> tag_avail_event; |
endfunction : release_tag |
|
function void write_hmc_rsp(input hmc_packet packet); |
if (packet.command != HMC_ERROR_RESPONSE) |
release_tag(packet.tag); |
endfunction : write_hmc_rsp |
|
function void idle_check(); |
if (num_tags_in_use > 0) |
for (int i=0; i<tag_count; i++) |
if (tags_in_use[i]) |
`uvm_fatal(get_type_name(), $psprintf("%0d tags still in use, first one is %0d!", num_tags_in_use, i)) |
if (tag_fifo.size() != tag_count) |
`uvm_fatal(get_type_name(), $psprintf("tag FIFO should have num_tags (%0d) entries it has %0d!", tag_count, tag_fifo.size())) |
endfunction : idle_check |
|
function void check_phase(uvm_phase phase); |
idle_check(); |
endfunction : check_phase |
|
function void report_phase(uvm_phase phase); |
`uvm_info(get_type_name(),$psprintf("max_tags_in_use %0d, transaction_count %0d", max_tags_in_use, transaction_count), UVM_LOW) |
endfunction : report_phase |
|
endclass : tag_handler |
|
`endif // TAG_HANDLER_SV |
/common/src/rgm/openhmc/register_file_model_16x.sv
0,0 → 1,436
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
// |
// HMC controller status |
// |
class reg_openhmc_rf_status_general_c extends cag_rgm_register; |
|
typedef struct packed { |
bit [15:0] lane_polarity_reversed_; |
bit [5:0] Reserved_0; |
bit [9:0] rx_tokens_remaining_; |
bit [5:0] Reserved_1; |
bit [9:0] hmc_tokens_remaining_; |
bit [5:0] Reserved_2; |
bit [0:0] phy_rx_ready_; |
bit [0:0] phy_tx_ready_; |
bit [2:0] Reserved_3; |
bit [0:0] lanes_reversed_; |
bit [0:0] FERR_N_; |
bit [0:0] sleep_mode_; |
bit [0:0] link_training_; |
bit [0:0] link_up_; |
} pkd_flds_s; |
|
`cag_rgm_register_fields(pkd_flds_s) |
|
`uvm_object_utils_begin(reg_openhmc_rf_status_general_c) |
`uvm_field_int(fields,UVM_ALL_ON) |
`uvm_object_utils_end |
|
function new(string name="reg_openhmc_rf_status_general_c"); |
super.new(name); |
this.name = name; |
set_address('h0); |
endfunction : new |
|
endclass : reg_openhmc_rf_status_general_c |
|
// |
// HMC controller initialization status |
// |
class reg_openhmc_rf_status_init_c extends cag_rgm_register; |
|
typedef struct packed { |
bit [1:0] tx_init_state_; |
bit [2:0] rx_init_state_; |
bit [0:0] all_descramblers_aligned_; |
bit [15:0] descrambler_aligned_; |
bit [15:0] descrambler_part_aligned_; |
bit [15:0] lane_descramblers_locked_; |
} pkd_flds_s; |
|
`cag_rgm_register_fields(pkd_flds_s) |
|
`uvm_object_utils_begin(reg_openhmc_rf_status_init_c) |
`uvm_field_int(fields,UVM_ALL_ON) |
`uvm_object_utils_end |
|
function new(string name="reg_openhmc_rf_status_init_c"); |
super.new(name); |
this.name = name; |
set_address('h8); |
endfunction : new |
|
endclass : reg_openhmc_rf_status_init_c |
|
// |
// HMC controller control |
// |
class reg_openhmc_rf_control_c extends cag_rgm_register; |
|
typedef struct packed { |
bit [5:0] bit_slip_time_; |
bit [2:0] Reserved_4; |
bit [4:0] irtry_to_send_; |
bit [2:0] Reserved_5; |
bit [4:0] irtry_received_threshold_; |
bit [5:0] Reserved_6; |
bit [9:0] rx_token_count_; |
bit [4:0] Reserved_7; |
bit [0:0] debug_halt_on_tx_retry_; |
bit [0:0] debug_halt_on_error_abort_; |
bit [0:0] debug_dont_send_tret_; |
bit [1:0] Reserved_8; |
bit [0:0] run_length_enable_; |
bit [0:0] scrambler_disable_; |
bit [0:0] warm_reset_; |
bit [0:0] set_hmc_sleep_; |
bit [0:0] hmc_init_cont_set_; |
bit [0:0] p_rst_n_; |
} pkd_flds_s; |
|
`cag_rgm_register_fields(pkd_flds_s) |
|
`uvm_object_utils_begin(reg_openhmc_rf_control_c) |
`uvm_field_int(fields,UVM_ALL_ON) |
`uvm_object_utils_end |
|
function new(string name="reg_openhmc_rf_control_c"); |
super.new(name); |
this.name = name; |
set_address('h10); |
endfunction : new |
|
endclass : reg_openhmc_rf_control_c |
|
// |
// Posted requests sent to the HMC |
// |
class reg_openhmc_rf_sent_p_c extends cag_rgm_register; |
|
typedef struct packed { |
bit [63:0] cnt_; |
} pkd_flds_s; |
|
`cag_rgm_register_fields(pkd_flds_s) |
|
`uvm_object_utils_begin(reg_openhmc_rf_sent_p_c) |
`uvm_field_int(fields,UVM_ALL_ON) |
`uvm_object_utils_end |
|
function new(string name="reg_openhmc_rf_sent_p_c"); |
super.new(name); |
this.name = name; |
set_address('h18); |
endfunction : new |
|
endclass : reg_openhmc_rf_sent_p_c |
|
// |
// Nonposted requests sent to the HMC |
// |
class reg_openhmc_rf_sent_np_c extends cag_rgm_register; |
|
typedef struct packed { |
bit [63:0] cnt_; |
} pkd_flds_s; |
|
`cag_rgm_register_fields(pkd_flds_s) |
|
`uvm_object_utils_begin(reg_openhmc_rf_sent_np_c) |
`uvm_field_int(fields,UVM_ALL_ON) |
`uvm_object_utils_end |
|
function new(string name="reg_openhmc_rf_sent_np_c"); |
super.new(name); |
this.name = name; |
set_address('h20); |
endfunction : new |
|
endclass : reg_openhmc_rf_sent_np_c |
|
// |
// Read requests sent to the HMC |
// |
class reg_openhmc_rf_sent_r_c extends cag_rgm_register; |
|
typedef struct packed { |
bit [63:0] cnt_; |
} pkd_flds_s; |
|
`cag_rgm_register_fields(pkd_flds_s) |
|
`uvm_object_utils_begin(reg_openhmc_rf_sent_r_c) |
`uvm_field_int(fields,UVM_ALL_ON) |
`uvm_object_utils_end |
|
function new(string name="reg_openhmc_rf_sent_r_c"); |
super.new(name); |
this.name = name; |
set_address('h28); |
endfunction : new |
|
endclass : reg_openhmc_rf_sent_r_c |
|
// |
// Count of packets that had data errors but valid flow information |
// |
class reg_openhmc_rf_poisoned_packets_c extends cag_rgm_register; |
|
typedef struct packed { |
bit [63:0] cnt_; |
} pkd_flds_s; |
|
`cag_rgm_register_fields(pkd_flds_s) |
|
`uvm_object_utils_begin(reg_openhmc_rf_poisoned_packets_c) |
`uvm_field_int(fields,UVM_ALL_ON) |
`uvm_object_utils_end |
|
function new(string name="reg_openhmc_rf_poisoned_packets_c"); |
super.new(name); |
this.name = name; |
set_address('h30); |
endfunction : new |
|
endclass : reg_openhmc_rf_poisoned_packets_c |
|
// |
// Responses received from the HMC |
// |
class reg_openhmc_rf_rcvd_rsp_c extends cag_rgm_register; |
|
typedef struct packed { |
bit [63:0] cnt_; |
} pkd_flds_s; |
|
`cag_rgm_register_fields(pkd_flds_s) |
|
`uvm_object_utils_begin(reg_openhmc_rf_rcvd_rsp_c) |
`uvm_field_int(fields,UVM_ALL_ON) |
`uvm_object_utils_end |
|
function new(string name="reg_openhmc_rf_rcvd_rsp_c"); |
super.new(name); |
this.name = name; |
set_address('h38); |
endfunction : new |
|
endclass : reg_openhmc_rf_rcvd_rsp_c |
|
// |
// Reset performance counters |
// |
class reg_openhmc_rf_counter_reset_c extends cag_rgm_register; |
|
typedef struct packed { |
bit rreinit_; |
} pkd_flds_s; |
|
`cag_rgm_register_fields(pkd_flds_s) |
|
`uvm_object_utils_begin(reg_openhmc_rf_counter_reset_c) |
`uvm_field_int(fields,UVM_ALL_ON) |
`uvm_object_utils_end |
|
function new(string name="reg_openhmc_rf_counter_reset_c"); |
super.new(name); |
this.name = name; |
set_address('h40); |
endfunction : new |
|
endclass : reg_openhmc_rf_counter_reset_c |
|
// |
// Count of re-transmit requests |
// |
class reg_openhmc_rf_tx_link_retries_c extends cag_rgm_register; |
|
typedef struct packed { |
bit [47:0] count_; |
} pkd_flds_s; |
|
`cag_rgm_register_fields(pkd_flds_s) |
|
`uvm_object_utils_begin(reg_openhmc_rf_tx_link_retries_c) |
`uvm_field_int(fields,UVM_ALL_ON) |
`uvm_object_utils_end |
|
function new(string name="reg_openhmc_rf_tx_link_retries_c"); |
super.new(name); |
this.name = name; |
set_address('h48); |
endfunction : new |
|
endclass : reg_openhmc_rf_tx_link_retries_c |
|
// |
// Count of errors seen on RX |
// |
class reg_openhmc_rf_errors_on_rx_c extends cag_rgm_register; |
|
typedef struct packed { |
bit [47:0] count_; |
} pkd_flds_s; |
|
`cag_rgm_register_fields(pkd_flds_s) |
|
`uvm_object_utils_begin(reg_openhmc_rf_errors_on_rx_c) |
`uvm_field_int(fields,UVM_ALL_ON) |
`uvm_object_utils_end |
|
function new(string name="reg_openhmc_rf_errors_on_rx_c"); |
super.new(name); |
this.name = name; |
set_address('h50); |
endfunction : new |
|
endclass : reg_openhmc_rf_errors_on_rx_c |
|
// |
// The number of bit_flips forced by the run length limiter |
// |
class reg_openhmc_rf_run_length_bit_flip_c extends cag_rgm_register; |
|
typedef struct packed { |
bit [47:0] count_; |
} pkd_flds_s; |
|
`cag_rgm_register_fields(pkd_flds_s) |
|
`uvm_object_utils_begin(reg_openhmc_rf_run_length_bit_flip_c) |
`uvm_field_int(fields,UVM_ALL_ON) |
`uvm_object_utils_end |
|
function new(string name="reg_openhmc_rf_run_length_bit_flip_c"); |
super.new(name); |
this.name = name; |
set_address('h58); |
endfunction : new |
|
endclass : reg_openhmc_rf_run_length_bit_flip_c |
|
// |
// Indicates the number of error abort modes not cleared in time |
// |
class reg_openhmc_rf_error_abort_not_cleared_c extends cag_rgm_register; |
|
typedef struct packed { |
bit [47:0] count_; |
} pkd_flds_s; |
|
`cag_rgm_register_fields(pkd_flds_s) |
|
`uvm_object_utils_begin(reg_openhmc_rf_error_abort_not_cleared_c) |
`uvm_field_int(fields,UVM_ALL_ON) |
`uvm_object_utils_end |
|
function new(string name="reg_openhmc_rf_error_abort_not_cleared_c"); |
super.new(name); |
this.name = name; |
set_address('h60); |
endfunction : new |
|
endclass : reg_openhmc_rf_error_abort_not_cleared_c |
|
class rf_openhmc_rf_c extends cag_rgm_register_file; |
|
rand reg_openhmc_rf_status_general_c status_general; |
rand reg_openhmc_rf_status_init_c status_init; |
rand reg_openhmc_rf_control_c control; |
rand reg_openhmc_rf_sent_p_c sent_p; |
rand reg_openhmc_rf_sent_np_c sent_np; |
rand reg_openhmc_rf_sent_r_c sent_r; |
rand reg_openhmc_rf_poisoned_packets_c poisoned_packets; |
rand reg_openhmc_rf_rcvd_rsp_c rcvd_rsp; |
rand reg_openhmc_rf_counter_reset_c counter_reset; |
rand reg_openhmc_rf_tx_link_retries_c tx_link_retries; |
rand reg_openhmc_rf_errors_on_rx_c errors_on_rx; |
rand reg_openhmc_rf_run_length_bit_flip_c run_length_bit_flip; |
rand reg_openhmc_rf_error_abort_not_cleared_c error_abort_not_cleared; |
|
`uvm_object_utils(rf_openhmc_rf_c) |
|
function new(string name="rf_openhmc_rf_c"); |
super.new(name); |
this.name = name; |
status_general = reg_openhmc_rf_status_general_c::type_id::create("status_general"); |
status_general.set_address('h0); |
add_register(status_general); |
status_init = reg_openhmc_rf_status_init_c::type_id::create("status_init"); |
status_init.set_address('h8); |
add_register(status_init); |
control = reg_openhmc_rf_control_c::type_id::create("control"); |
control.set_address('h10); |
add_register(control); |
sent_p = reg_openhmc_rf_sent_p_c::type_id::create("sent_p"); |
sent_p.set_address('h18); |
add_register(sent_p); |
sent_np = reg_openhmc_rf_sent_np_c::type_id::create("sent_np"); |
sent_np.set_address('h20); |
add_register(sent_np); |
sent_r = reg_openhmc_rf_sent_r_c::type_id::create("sent_r"); |
sent_r.set_address('h28); |
add_register(sent_r); |
poisoned_packets = reg_openhmc_rf_poisoned_packets_c::type_id::create("poisoned_packets"); |
poisoned_packets.set_address('h30); |
add_register(poisoned_packets); |
rcvd_rsp = reg_openhmc_rf_rcvd_rsp_c::type_id::create("rcvd_rsp"); |
rcvd_rsp.set_address('h38); |
add_register(rcvd_rsp); |
counter_reset = reg_openhmc_rf_counter_reset_c::type_id::create("counter_reset"); |
counter_reset.set_address('h40); |
add_register(counter_reset); |
tx_link_retries = reg_openhmc_rf_tx_link_retries_c::type_id::create("tx_link_retries"); |
tx_link_retries.set_address('h48); |
add_register(tx_link_retries); |
errors_on_rx = reg_openhmc_rf_errors_on_rx_c::type_id::create("errors_on_rx"); |
errors_on_rx.set_address('h50); |
add_register(errors_on_rx); |
run_length_bit_flip = reg_openhmc_rf_run_length_bit_flip_c::type_id::create("run_length_bit_flip"); |
run_length_bit_flip.set_address('h58); |
add_register(run_length_bit_flip); |
error_abort_not_cleared = reg_openhmc_rf_error_abort_not_cleared_c::type_id::create("error_abort_not_cleared"); |
error_abort_not_cleared.set_address('h60); |
add_register(error_abort_not_cleared); |
endfunction : new |
|
endclass : rf_openhmc_rf_c |
|
/common/src/rgm/openhmc/register_file_model_8x.sv
0,0 → 1,439
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
// |
// HMC controller status |
// |
class reg_openhmc_rf_status_general_c extends cag_rgm_register; |
|
typedef struct packed { |
bit [7:0] lane_polarity_reversed_; |
bit [5:0] Reserved_0; |
bit [9:0] rx_tokens_remaining_; |
bit [5:0] Reserved_1; |
bit [9:0] hmc_tokens_remaining_; |
bit [5:0] Reserved_2; |
bit [0:0] phy_rx_ready_; |
bit [0:0] phy_tx_ready_; |
bit [2:0] Reserved_3; |
bit [0:0] lanes_reversed_; |
bit [0:0] FERR_N_; |
bit [0:0] sleep_mode_; |
bit [0:0] link_training_; |
bit [0:0] link_up_; |
} pkd_flds_s; |
|
`cag_rgm_register_fields(pkd_flds_s) |
|
`uvm_object_utils_begin(reg_openhmc_rf_status_general_c) |
`uvm_field_int(fields,UVM_ALL_ON) |
`uvm_object_utils_end |
|
function new(string name="reg_openhmc_rf_status_general_c"); |
super.new(name); |
this.name = name; |
set_address('h0); |
endfunction : new |
|
endclass : reg_openhmc_rf_status_general_c |
|
// |
// HMC controller initialization status |
// |
class reg_openhmc_rf_status_init_c extends cag_rgm_register; |
|
typedef struct packed { |
bit [1:0] tx_init_state_; |
bit [2:0] rx_init_state_; |
bit [0:0] all_descramblers_aligned_; |
bit [7:0] Reserved_4; |
bit [7:0] descrambler_aligned_; |
bit [7:0] Reserved_5; |
bit [7:0] descrambler_part_aligned_; |
bit [7:0] Reserved_6; |
bit [7:0] lane_descramblers_locked_; |
} pkd_flds_s; |
|
`cag_rgm_register_fields(pkd_flds_s) |
|
`uvm_object_utils_begin(reg_openhmc_rf_status_init_c) |
`uvm_field_int(fields,UVM_ALL_ON) |
`uvm_object_utils_end |
|
function new(string name="reg_openhmc_rf_status_init_c"); |
super.new(name); |
this.name = name; |
set_address('h8); |
endfunction : new |
|
endclass : reg_openhmc_rf_status_init_c |
|
// |
// HMC controller control |
// |
class reg_openhmc_rf_control_c extends cag_rgm_register; |
|
typedef struct packed { |
bit [5:0] bit_slip_time_; |
bit [2:0] Reserved_7; |
bit [4:0] irtry_to_send_; |
bit [2:0] Reserved_8; |
bit [4:0] irtry_received_threshold_; |
bit [5:0] Reserved_9; |
bit [9:0] rx_token_count_; |
bit [4:0] Reserved_10; |
bit [0:0] debug_halt_on_tx_retry_; |
bit [0:0] debug_halt_on_error_abort_; |
bit [0:0] debug_dont_send_tret_; |
bit [1:0] Reserved_11; |
bit [0:0] run_length_enable_; |
bit [0:0] scrambler_disable_; |
bit [0:0] warm_reset_; |
bit [0:0] set_hmc_sleep_; |
bit [0:0] hmc_init_cont_set_; |
bit [0:0] p_rst_n_; |
} pkd_flds_s; |
|
`cag_rgm_register_fields(pkd_flds_s) |
|
`uvm_object_utils_begin(reg_openhmc_rf_control_c) |
`uvm_field_int(fields,UVM_ALL_ON) |
`uvm_object_utils_end |
|
function new(string name="reg_openhmc_rf_control_c"); |
super.new(name); |
this.name = name; |
set_address('h10); |
endfunction : new |
|
endclass : reg_openhmc_rf_control_c |
|
// |
// Posted requests sent to the HMC |
// |
class reg_openhmc_rf_sent_p_c extends cag_rgm_register; |
|
typedef struct packed { |
bit [63:0] cnt_; |
} pkd_flds_s; |
|
`cag_rgm_register_fields(pkd_flds_s) |
|
`uvm_object_utils_begin(reg_openhmc_rf_sent_p_c) |
`uvm_field_int(fields,UVM_ALL_ON) |
`uvm_object_utils_end |
|
function new(string name="reg_openhmc_rf_sent_p_c"); |
super.new(name); |
this.name = name; |
set_address('h18); |
endfunction : new |
|
endclass : reg_openhmc_rf_sent_p_c |
|
// |
// Nonposted requests sent to the HMC |
// |
class reg_openhmc_rf_sent_np_c extends cag_rgm_register; |
|
typedef struct packed { |
bit [63:0] cnt_; |
} pkd_flds_s; |
|
`cag_rgm_register_fields(pkd_flds_s) |
|
`uvm_object_utils_begin(reg_openhmc_rf_sent_np_c) |
`uvm_field_int(fields,UVM_ALL_ON) |
`uvm_object_utils_end |
|
function new(string name="reg_openhmc_rf_sent_np_c"); |
super.new(name); |
this.name = name; |
set_address('h20); |
endfunction : new |
|
endclass : reg_openhmc_rf_sent_np_c |
|
// |
// Read requests sent to the HMC |
// |
class reg_openhmc_rf_sent_r_c extends cag_rgm_register; |
|
typedef struct packed { |
bit [63:0] cnt_; |
} pkd_flds_s; |
|
`cag_rgm_register_fields(pkd_flds_s) |
|
`uvm_object_utils_begin(reg_openhmc_rf_sent_r_c) |
`uvm_field_int(fields,UVM_ALL_ON) |
`uvm_object_utils_end |
|
function new(string name="reg_openhmc_rf_sent_r_c"); |
super.new(name); |
this.name = name; |
set_address('h28); |
endfunction : new |
|
endclass : reg_openhmc_rf_sent_r_c |
|
// |
// Count of packets that had data errors but valid flow information |
// |
class reg_openhmc_rf_poisoned_packets_c extends cag_rgm_register; |
|
typedef struct packed { |
bit [63:0] cnt_; |
} pkd_flds_s; |
|
`cag_rgm_register_fields(pkd_flds_s) |
|
`uvm_object_utils_begin(reg_openhmc_rf_poisoned_packets_c) |
`uvm_field_int(fields,UVM_ALL_ON) |
`uvm_object_utils_end |
|
function new(string name="reg_openhmc_rf_poisoned_packets_c"); |
super.new(name); |
this.name = name; |
set_address('h30); |
endfunction : new |
|
endclass : reg_openhmc_rf_poisoned_packets_c |
|
// |
// Responses received from the HMC |
// |
class reg_openhmc_rf_rcvd_rsp_c extends cag_rgm_register; |
|
typedef struct packed { |
bit [63:0] cnt_; |
} pkd_flds_s; |
|
`cag_rgm_register_fields(pkd_flds_s) |
|
`uvm_object_utils_begin(reg_openhmc_rf_rcvd_rsp_c) |
`uvm_field_int(fields,UVM_ALL_ON) |
`uvm_object_utils_end |
|
function new(string name="reg_openhmc_rf_rcvd_rsp_c"); |
super.new(name); |
this.name = name; |
set_address('h38); |
endfunction : new |
|
endclass : reg_openhmc_rf_rcvd_rsp_c |
|
// |
// Reset performance counters |
// |
class reg_openhmc_rf_counter_reset_c extends cag_rgm_register; |
|
typedef struct packed { |
bit rreinit_; |
} pkd_flds_s; |
|
`cag_rgm_register_fields(pkd_flds_s) |
|
`uvm_object_utils_begin(reg_openhmc_rf_counter_reset_c) |
`uvm_field_int(fields,UVM_ALL_ON) |
`uvm_object_utils_end |
|
function new(string name="reg_openhmc_rf_counter_reset_c"); |
super.new(name); |
this.name = name; |
set_address('h40); |
endfunction : new |
|
endclass : reg_openhmc_rf_counter_reset_c |
|
// |
// Count of re-transmit requests |
// |
class reg_openhmc_rf_tx_link_retries_c extends cag_rgm_register; |
|
typedef struct packed { |
bit [47:0] count_; |
} pkd_flds_s; |
|
`cag_rgm_register_fields(pkd_flds_s) |
|
`uvm_object_utils_begin(reg_openhmc_rf_tx_link_retries_c) |
`uvm_field_int(fields,UVM_ALL_ON) |
`uvm_object_utils_end |
|
function new(string name="reg_openhmc_rf_tx_link_retries_c"); |
super.new(name); |
this.name = name; |
set_address('h48); |
endfunction : new |
|
endclass : reg_openhmc_rf_tx_link_retries_c |
|
// |
// Count of errors seen on RX |
// |
class reg_openhmc_rf_errors_on_rx_c extends cag_rgm_register; |
|
typedef struct packed { |
bit [47:0] count_; |
} pkd_flds_s; |
|
`cag_rgm_register_fields(pkd_flds_s) |
|
`uvm_object_utils_begin(reg_openhmc_rf_errors_on_rx_c) |
`uvm_field_int(fields,UVM_ALL_ON) |
`uvm_object_utils_end |
|
function new(string name="reg_openhmc_rf_errors_on_rx_c"); |
super.new(name); |
this.name = name; |
set_address('h50); |
endfunction : new |
|
endclass : reg_openhmc_rf_errors_on_rx_c |
|
// |
// The number of bit_flips forced by the run length limiter |
// |
class reg_openhmc_rf_run_length_bit_flip_c extends cag_rgm_register; |
|
typedef struct packed { |
bit [47:0] count_; |
} pkd_flds_s; |
|
`cag_rgm_register_fields(pkd_flds_s) |
|
`uvm_object_utils_begin(reg_openhmc_rf_run_length_bit_flip_c) |
`uvm_field_int(fields,UVM_ALL_ON) |
`uvm_object_utils_end |
|
function new(string name="reg_openhmc_rf_run_length_bit_flip_c"); |
super.new(name); |
this.name = name; |
set_address('h58); |
endfunction : new |
|
endclass : reg_openhmc_rf_run_length_bit_flip_c |
|
// |
// Indicates the number of error abort modes not cleared in time |
// |
class reg_openhmc_rf_error_abort_not_cleared_c extends cag_rgm_register; |
|
typedef struct packed { |
bit [47:0] count_; |
} pkd_flds_s; |
|
`cag_rgm_register_fields(pkd_flds_s) |
|
`uvm_object_utils_begin(reg_openhmc_rf_error_abort_not_cleared_c) |
`uvm_field_int(fields,UVM_ALL_ON) |
`uvm_object_utils_end |
|
function new(string name="reg_openhmc_rf_error_abort_not_cleared_c"); |
super.new(name); |
this.name = name; |
set_address('h60); |
endfunction : new |
|
endclass : reg_openhmc_rf_error_abort_not_cleared_c |
|
class rf_openhmc_rf_c extends cag_rgm_register_file; |
|
rand reg_openhmc_rf_status_general_c status_general; |
rand reg_openhmc_rf_status_init_c status_init; |
rand reg_openhmc_rf_control_c control; |
rand reg_openhmc_rf_sent_p_c sent_p; |
rand reg_openhmc_rf_sent_np_c sent_np; |
rand reg_openhmc_rf_sent_r_c sent_r; |
rand reg_openhmc_rf_poisoned_packets_c poisoned_packets; |
rand reg_openhmc_rf_rcvd_rsp_c rcvd_rsp; |
rand reg_openhmc_rf_counter_reset_c counter_reset; |
rand reg_openhmc_rf_tx_link_retries_c tx_link_retries; |
rand reg_openhmc_rf_errors_on_rx_c errors_on_rx; |
rand reg_openhmc_rf_run_length_bit_flip_c run_length_bit_flip; |
rand reg_openhmc_rf_error_abort_not_cleared_c error_abort_not_cleared; |
|
`uvm_object_utils(rf_openhmc_rf_c) |
|
function new(string name="rf_openhmc_rf_c"); |
super.new(name); |
this.name = name; |
status_general = reg_openhmc_rf_status_general_c::type_id::create("status_general"); |
status_general.set_address('h0); |
add_register(status_general); |
status_init = reg_openhmc_rf_status_init_c::type_id::create("status_init"); |
status_init.set_address('h8); |
add_register(status_init); |
control = reg_openhmc_rf_control_c::type_id::create("control"); |
control.set_address('h10); |
add_register(control); |
sent_p = reg_openhmc_rf_sent_p_c::type_id::create("sent_p"); |
sent_p.set_address('h18); |
add_register(sent_p); |
sent_np = reg_openhmc_rf_sent_np_c::type_id::create("sent_np"); |
sent_np.set_address('h20); |
add_register(sent_np); |
sent_r = reg_openhmc_rf_sent_r_c::type_id::create("sent_r"); |
sent_r.set_address('h28); |
add_register(sent_r); |
poisoned_packets = reg_openhmc_rf_poisoned_packets_c::type_id::create("poisoned_packets"); |
poisoned_packets.set_address('h30); |
add_register(poisoned_packets); |
rcvd_rsp = reg_openhmc_rf_rcvd_rsp_c::type_id::create("rcvd_rsp"); |
rcvd_rsp.set_address('h38); |
add_register(rcvd_rsp); |
counter_reset = reg_openhmc_rf_counter_reset_c::type_id::create("counter_reset"); |
counter_reset.set_address('h40); |
add_register(counter_reset); |
tx_link_retries = reg_openhmc_rf_tx_link_retries_c::type_id::create("tx_link_retries"); |
tx_link_retries.set_address('h48); |
add_register(tx_link_retries); |
errors_on_rx = reg_openhmc_rf_errors_on_rx_c::type_id::create("errors_on_rx"); |
errors_on_rx.set_address('h50); |
add_register(errors_on_rx); |
run_length_bit_flip = reg_openhmc_rf_run_length_bit_flip_c::type_id::create("run_length_bit_flip"); |
run_length_bit_flip.set_address('h58); |
add_register(run_length_bit_flip); |
error_abort_not_cleared = reg_openhmc_rf_error_abort_not_cleared_c::type_id::create("error_abort_not_cleared"); |
error_abort_not_cleared.set_address('h60); |
add_register(error_abort_not_cleared); |
endfunction : new |
|
endclass : rf_openhmc_rf_c |
|
/common/src/serdes/behavioral/serdes_behavioral.f
0,0 → 1,40
# |
# .--------------. .----------------. .------------. |
# | .------------. | .--------------. | .----------. | |
# | | ____ ____ | | | ____ ____ | | | ______ | | |
# | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
# ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
# / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
# (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
# \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
# | | | | | | | | | | | | |
# |_| | '------------' | '--------------' | '----------' | |
# '--------------' '----------------' '------------' |
# |
# openHMC - An Open Source Hybrid Memory Cube Controller |
# (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
# www.ziti.uni-heidelberg.de |
# B6, 26 |
# 68159 Mannheim |
# Germany |
# |
# Contact: openhmc@ziti.uni-heidelberg.de |
# http://ra.ziti.uni-heidelberg.de/openhmc |
# |
# This source file is free software: you can redistribute it and/or modify |
# it under the terms of the GNU Lesser General Public License as published by |
# the Free Software Foundation, either version 3 of the License, or |
# (at your option) any later version. |
# |
# This source file is distributed in the hope that it will be useful, |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
# GNU Lesser General Public License for more details. |
# |
# You should have received a copy of the GNU Lesser General Public License |
# along with this source file. If not, see <http://www.gnu.org/licenses/>. |
# |
# |
|
${OPENHMC_SIM}/tb/common/src/serdes/behavioral/deserializer.v |
${OPENHMC_SIM}/tb/common/src/serdes/behavioral/serializer.v |
/common/src/serdes/behavioral/deserializer.v
0,0 → 1,113
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
module deserializer #( |
parameter LOG_DWIDTH=7, |
parameter DWIDTH=64 |
) |
( |
input wire clk, |
input wire res_n, |
input wire fast_clk, |
input wire bit_slip, |
input wire data_in, |
output wire [DWIDTH-1:0]data_out, |
input wire lane_polarity |
); |
|
reg [DWIDTH-1:0] tmp_buffer; |
reg [DWIDTH-1:0] buffer; |
reg [DWIDTH-1:0] buffer2; |
reg [DWIDTH-1:0] data_out_temp; |
reg [LOG_DWIDTH-1:0]curr_bit = 'h0; |
reg [5:0] bit_slip_cnt; |
reg bit_slip_done = 1'b0; |
|
reg d_in_dly; |
|
assign data_out = lane_polarity ? data_out_temp^{DWIDTH{1'b1}} : data_out_temp; |
|
// SEQUENTIAL PROCESS |
always @ (posedge fast_clk) begin |
if(!res_n) begin |
curr_bit <= {LOG_DWIDTH{1'b0}}; |
bit_slip_done <= 1'b0; |
end else begin |
|
#1ps d_in_dly <= data_in; |
|
if (!bit_slip || bit_slip_done) begin |
if(curr_bit == DWIDTH-1) begin |
curr_bit <= 0; |
end else begin |
curr_bit <= curr_bit + 1; |
end |
end |
|
if (bit_slip && !bit_slip_done) |
bit_slip_done <= 1'b1; |
|
if (bit_slip_done && !bit_slip) |
bit_slip_done <= 1'b0; |
|
if (|curr_bit == 1'b0) begin |
buffer <= tmp_buffer; |
end |
tmp_buffer[curr_bit] <= d_in_dly; |
end |
end |
|
always @ (posedge clk) begin |
if(!res_n) begin |
bit_slip_cnt <= 6'h0; |
end else begin |
if(bit_slip) |
bit_slip_cnt <= bit_slip_cnt + 1; |
|
buffer2 <= buffer; |
|
if(bit_slip_cnt < DWIDTH-1) begin |
data_out_temp <= buffer2; |
end else begin |
data_out_temp <= buffer; |
end |
end |
end |
|
endmodule |
|
/common/src/serdes/behavioral/serializer.v
0,0 → 1,68
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
module serializer #( |
parameter DWIDTH=64 |
) |
( |
input wire clk, |
input wire fast_clk, |
input wire res_n, |
input wire [DWIDTH-1:0] data_in, |
output wire data_out |
); |
|
reg [7:0] curr_bit = 'h0; |
|
always @ (posedge fast_clk) |
begin |
if(!res_n) begin |
curr_bit <= 0; |
end else begin |
if(curr_bit == DWIDTH-1) |
curr_bit <= 0; |
else |
curr_bit <= curr_bit + 1; |
end |
end |
|
assign data_out = data_in[curr_bit]; |
|
endmodule |
|
/common/src/bfm_2_hmc_monitor.sv
0,0 → 1,352
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
`ifndef BFM_2_HMC |
`define BFM_2_HMC |
class bfm_2_hmc_mon extends hmc_module_mon; |
|
typedef enum { |
LENGTH_ERROR, |
CRC_ERROR, |
SEQ_ERROR, |
POISON |
}error_class_e; |
|
mailbox#(cls_pkt) in_mb; |
cls_pkt pkt; |
|
bit [2:0] seq_number = 0; |
|
bit bitstream[]; |
|
int phit_size = 64; |
bit [64:0] header; //-- phit size |
bit [64:0] tail ; //-- phit size |
int data_phit_count; |
|
int flit_size = 128; |
|
bit error_abort_mode = 0; |
int irtry_cnt = 0; |
|
int irtry = 0; |
|
|
hmc_link_config link_cfg; |
|
error_class_e current_error; |
hmc_command_encoding current_command; |
|
|
int lng_error = 0; |
int crc_error = 0; |
int seq_error = 0; |
int poisoned_pkt =0; |
|
int rsp_rcvd = 0; |
int err_rsp_rcvd = 0; |
int req_rcvd = 0; |
|
hmc_link_config hmc_link_cfg; |
|
`uvm_component_utils_begin(bfm_2_hmc_mon) |
`uvm_field_object(link_cfg, UVM_DEFAULT) |
`uvm_component_utils_end |
covergroup hmc_pkt_error_cg; |
option.per_instance = 1; |
ERROR_TYPE: coverpoint current_error; |
|
HMC_COMMAND: coverpoint current_command { |
//bins request_commands[] = |
bins flow_types[] = { |
HMC_TRET, |
HMC_PRET, |
HMC_NULL |
}; |
bins requests[] = { |
HMC_WRITE_16, |
HMC_WRITE_32, |
HMC_WRITE_48, |
HMC_WRITE_64, |
HMC_WRITE_80, |
HMC_WRITE_96, |
HMC_WRITE_112, |
HMC_WRITE_128, |
|
HMC_MODE_WRITE, |
HMC_BIT_WRITE, |
HMC_DUAL_8B_ADDI, |
HMC_SINGLE_16B_ADDI, |
|
HMC_POSTED_WRITE_16, |
HMC_POSTED_WRITE_32, |
HMC_POSTED_WRITE_48, |
HMC_POSTED_WRITE_64, |
HMC_POSTED_WRITE_80, |
HMC_POSTED_WRITE_96, |
HMC_POSTED_WRITE_112, |
HMC_POSTED_WRITE_128, |
HMC_POSTED_BIT_WRIT, |
|
HMC_POSTED_BIT_WRIT, |
HMC_POSTED_DUAL_8B_ADDI, |
HMC_POSTED_SINGLE_16B_ADDI, |
|
HMC_MODE_READ, |
HMC_READ_16, |
HMC_READ_32, |
HMC_READ_48, |
HMC_READ_64, |
HMC_READ_80, |
HMC_READ_96, |
HMC_READ_112, |
HMC_READ_128}; |
|
bins response[] = { |
HMC_READ_RESPONSE, |
HMC_WRITE_RESPONSE, |
HMC_MODE_READ_RESPONSE, |
HMC_MODE_WRITE_RESPONSE, |
HMC_ERROR_RESPONSE |
}; |
|
illegal_bins n_used = default; |
} |
CROSS_ERROR_TYPPE_COMMAND : cross ERROR_TYPE, HMC_COMMAND; |
|
endgroup |
|
function new ( string name="bfm_2_hmc_mon", uvm_component parent ); |
super.new(name, parent); |
hmc_pkt_cg = new(); |
hmc_pkt_error_cg = new(); |
endfunction : new |
|
function void build_phase(uvm_phase phase); |
super.build_phase(phase); |
|
if (!uvm_config_db#(hmc_link_config)::get(this, "", "link_cfg", link_cfg)) begin |
uvm_report_fatal(get_type_name(), $psprintf("hmc_link_config not set via config_db")); |
end |
endfunction : build_phase |
|
task run(); |
cls_pkt old_pkt; |
`uvm_info(get_type_name(),$psprintf("starting BFM_2_HMC converter"), UVM_MEDIUM) |
forever begin |
//mb_pkt.get(pkt); |
old_pkt = pkt; |
in_mb.peek(pkt); |
if (pkt != old_pkt) |
extract_hmc_pkt(pkt); |
else |
#5; |
end |
|
endtask |
|
task extract_hmc_pkt(cls_pkt pkt); |
header = pkt.get_header(); |
tail = pkt.get_tail(); |
data_phit_count = pkt.data.size(); //-- 7 flits->14 phits --> 14-2 =12 data_phits |
|
bitstream = new [2*phit_size + data_phit_count*phit_size]; |
|
//-- generate Bitstream |
|
if (header !=64'b0) begin |
|
//-- check length |
if( (header[10:7] != header[14:11]) || (header[10:7] != 1+data_phit_count /2)) begin |
lng_error ++; |
error_abort_mode = 1; |
`uvm_info(get_type_name(),$psprintf("Set error abort mode: LNG/DLN ERROR, Command with header: %h", header), UVM_NONE) |
irtry_cnt = 0; |
|
|
current_error = LENGTH_ERROR; |
current_command[5:0] = header[5:0]; |
hmc_pkt_error_cg.sample(); |
end else begin |
|
//-- convert the cls_pkt pkt to hmc_packet packet |
cls_pkt_to_hmc_packet(pkt); |
|
//-- check crc error |
check_crc_error(packet); |
|
|
//-- wait for irtry |
if (error_abort_mode) |
clear_error_abort_mode(); |
|
else begin |
|
//-- count Start Error Mode IRTRY |
if (packet.start_retry) begin |
irtry++; |
`uvm_info(get_type_name(),$psprintf("Start Retry: %0d", irtry), UVM_HIGH) |
end |
|
//-- packet sequence check |
if ((packet.command == HMC_TRET) || (packet.get_command_type() != HMC_FLOW_TYPE)) begin |
irtry = 0; //-- reset start retry mode counter |
|
if (packet.sequence_number != seq_number+1'b1) begin |
seq_error ++; |
error_abort_mode = 1; |
`uvm_info(get_type_name(),$psprintf("Set error abort mode: SEQ ERROR, Command: %s", packet.command.name()), UVM_NONE) |
irtry_cnt = 0; |
|
|
//-- sample seq error |
current_error = SEQ_ERROR; |
current_command = packet.command; |
hmc_pkt_error_cg.sample(); |
|
end else begin |
|
seq_number = packet.sequence_number; |
|
//-- check if poisoned |
if ( packet.poisoned) begin |
poisoned_pkt++; |
|
//-- sample poison |
current_error = POISON; |
current_command = packet.command; |
hmc_pkt_error_cg.sample(); |
end else |
if((packet.get_command_type() != HMC_FLOW_TYPE)) |
write_packet(packet); |
end |
end |
end |
end |
end |
|
endtask : extract_hmc_pkt |
|
|
|
function void check_crc_error(hmc_packet packet); |
if (packet.crc_error) begin |
crc_error++; |
error_abort_mode = 1; |
`uvm_info(get_type_name(),$psprintf("Set error abort mode: CRC ERROR, Command: %s", packet.command.name()), UVM_NONE) |
irtry_cnt = 0; |
|
current_error = CRC_ERROR; |
current_command = packet.command; |
hmc_pkt_error_cg.sample(); |
end |
endfunction : check_crc_error |
|
function void clear_error_abort_mode(); |
if ((packet.clear_error_abort)) begin |
`uvm_info(get_type_name(), $psprintf("Clear Error Abort Mode: %0d",irtry_cnt ), UVM_HIGH) |
irtry_cnt ++; |
end else begin |
irtry_cnt = 0; //-- reset counter |
end |
|
if (irtry_cnt >= link_cfg.cfg_init_retry_rxcnt) begin //-- test threshold |
error_abort_mode = 0; |
`uvm_info(get_type_name(), $psprintf("Clear Error Abort Mode" ), UVM_NONE) |
end |
endfunction : clear_error_abort_mode |
|
|
function void cls_pkt_to_hmc_packet (cls_pkt pkt); |
//-- Convert the CLS_PKT to HMC_PKT |
for (int b = 0; b < 64; b++) begin //-- read header to bitmap |
bitstream[b]=header[b]; |
end |
|
if (data_phit_count > 0) |
for (int phit = 0; phit < data_phit_count; phit++) //-- read data to bitmap |
for (int b = 0; b < phit_size; b++) |
bitstream[(phit + 1) * phit_size + b] = pkt.data[phit][b]; |
|
for (int b = 0; b < 64; b++) begin //-- read tail to bitmap |
bitstream[(data_phit_count+1)*phit_size+b]=tail[b]; |
end |
|
//-- create hmc packet |
`uvm_info(get_type_name(),$psprintf("Got a BFM Packet: %s",pkt.convert2string()), UVM_HIGH) |
packet = hmc_packet::type_id::create("packet", this); |
void'(packet.unpack(bitstream)); |
|
endfunction : cls_pkt_to_hmc_packet |
|
task write_packet(hmc_packet packet); |
|
if(packet.get_command_type() == HMC_RESPONSE_TYPE)begin |
if(packet.command != HMC_ERROR_RESPONSE) begin |
`uvm_info(get_type_name(),$psprintf("Rsp #%0d : %s",rsp_rcvd, packet.command.name()), UVM_HIGH) |
`uvm_info(get_type_name(),$psprintf("Rsp #%0d : %s",rsp_rcvd, packet.sprint()), UVM_HIGH) |
rsp_rcvd++; |
end else begin |
`uvm_info(get_type_name(),$psprintf("Err Rsp %0d : %s with error code %b",err_rsp_rcvd, packet.command.name(), packet.error_status), UVM_HIGH) |
err_rsp_rcvd++; |
end |
end else begin |
`uvm_info(get_type_name(),$psprintf("Req %0d : %s",req_rcvd, packet.command.name()), UVM_HIGH) |
req_rcvd++; |
end |
|
|
hmc_pkt_cg.sample(); |
|
item_collected_port.write(packet); |
|
endtask : write_packet |
|
|
function void report_phase(uvm_phase phase); |
`uvm_info(get_type_name(),$psprintf("LNG error count %0d", lng_error), UVM_NONE) |
`uvm_info(get_type_name(),$psprintf("CRC error count %0d", crc_error), UVM_NONE) |
`uvm_info(get_type_name(),$psprintf("SEQ error count %0d", seq_error), UVM_NONE) |
`uvm_info(get_type_name(),$psprintf("poisoned packets %0d", poisoned_pkt), UVM_NONE) |
endfunction : report_phase |
|
endclass |
|
|
`endif |
/common/src/hmc_req_packet.sv
0,0 → 1,111
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// hmc_req_packet |
// |
|
// Only requests should be sent to test the controller |
// All of the tail fields should be zero |
|
`ifndef HMC_REQ_PACKET_SV |
`define HMC_REQ_PACKET_SV |
|
class hmc_req_packet extends hmc_packet; |
`uvm_object_utils(hmc_req_packet) |
|
constraint req_command_c { |
command inside { HMC_WRITE_16, |
HMC_WRITE_32, |
HMC_WRITE_48, |
HMC_WRITE_64, |
HMC_WRITE_80, |
HMC_WRITE_96, |
HMC_WRITE_112, |
HMC_WRITE_128, |
|
//HMC_MODE_WRITE, |
HMC_BIT_WRITE, |
HMC_DUAL_8B_ADDI, |
HMC_SINGLE_16B_ADDI, |
|
HMC_POSTED_WRITE_16, |
HMC_POSTED_WRITE_32, |
HMC_POSTED_WRITE_48, |
HMC_POSTED_WRITE_64, |
HMC_POSTED_WRITE_80, |
HMC_POSTED_WRITE_96, |
HMC_POSTED_WRITE_112, |
HMC_POSTED_WRITE_128, |
HMC_POSTED_BIT_WRIT, |
|
HMC_POSTED_BIT_WRIT, |
HMC_POSTED_DUAL_8B_ADDI, |
HMC_POSTED_SINGLE_16B_ADDI, |
|
// HMC_MODE_READ, |
HMC_READ_16, |
HMC_READ_32, |
HMC_READ_48, |
HMC_READ_64, |
HMC_READ_80, |
HMC_READ_96, |
HMC_READ_112, |
HMC_READ_128 |
|
}; |
} |
|
|
constraint c_zero_tail_fields { |
return_token_count == 0; |
sequence_number == 0; |
forward_retry_pointer == 0; |
return_retry_pointer == 0; |
packet_crc == 0; |
} |
|
function new (string name = "hmc_req_packet"); |
super.new(name); |
endfunction : new |
|
endclass : hmc_req_packet |
|
`endif // HMC_REQ_PACKET_SV |
|
/common/src/hmc_2_axi4_sequence.sv
0,0 → 1,304
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// hmc_2_axi4_sequence |
// |
// |
|
`ifndef HMC_2_AXI4_SEQUENCE_SV |
`define HMC_2_AXI4_SEQUENCE_SV |
|
class hmc_2_axi4_sequence #(parameter DATA_BYTES = 16, parameter TUSER_WIDTH = 16) extends uvm_sequence #(axi4_stream_valid_cycle #(.DATA_BYTES(DATA_BYTES), .TUSER_WIDTH(TUSER_WIDTH))); |
|
int unsigned num_packets = 1; //-- packets to generate |
int unsigned max_pkts_per_cycle = 4; //-- maximum packets in single AXI4 cycle |
|
|
rand hmc_req_packet hmc_items[]; |
hmc_packet hmc_packets_ready[$]; |
|
int working_pos = 0; |
|
|
typedef bit [1+1+1+127:0] tail_header_flit_t; |
tail_header_flit_t flit_queue[$]; |
rand int tag = 0; |
|
constraint tag_value_c { |
tag >= 0; |
tag < 512; |
} |
|
axi4_stream_valid_cycle #(.DATA_BYTES(DATA_BYTES),.TUSER_WIDTH(TUSER_WIDTH)) axi4_queue[$]; |
|
`uvm_object_param_utils_begin(hmc_2_axi4_sequence #(.DATA_BYTES(DATA_BYTES),.TUSER_WIDTH(TUSER_WIDTH))) |
`uvm_field_int(num_packets, UVM_DEFAULT | UVM_DEC) |
`uvm_field_int(max_pkts_per_cycle, UVM_DEFAULT | UVM_DEC) |
`uvm_object_utils_end |
|
`uvm_declare_p_sequencer(hmc_2_axi4_sequencer #(.DATA_BYTES(DATA_BYTES),.TUSER_WIDTH(TUSER_WIDTH))) |
|
|
function new(string name="hmc_2_axi4_sequence"); |
super.new(name); |
|
endfunction : new |
|
function void pre_randomize (); |
super.pre_randomize(); |
|
hmc_items = new[num_packets]; |
|
foreach (hmc_items[i]) begin |
hmc_items[i] = hmc_req_packet::type_id::create($psprintf("hmc_item[%0d]", i) ); |
end |
|
`uvm_info(get_type_name(),$psprintf("%0d HMC packets generated", num_packets), UVM_HIGH) |
endfunction : pre_randomize |
|
function void pack_hmc_packet(hmc_packet pkt); |
bit bitstream[]; |
tail_header_flit_t tmp_flit; |
|
int unsigned bitcount; |
int unsigned packet_count=1; |
|
bitcount = pkt.pack(bitstream); |
|
pkt_successfully_packed : assert (bitcount > 0); |
|
//-- For each FLIT in the packet, add the flit entry |
for (int f=0; f<bitcount/128; f++) begin |
for (int i=0; i< 128; i++) |
tmp_flit[i] = bitstream[f*128+i]; |
|
tmp_flit[128] = (f==0); //-- Header |
|
tmp_flit[129] = (f==bitcount/128-1); //-- Tail |
|
tmp_flit[130] = 1'b1; //-- Flit is valid |
|
flit_queue.push_back(tmp_flit); |
end |
endfunction : pack_hmc_packet |
|
function void hmc_packet_2_axi_cycles(); |
|
axi4_stream_valid_cycle #(.DATA_BYTES(DATA_BYTES),.TUSER_WIDTH(TUSER_WIDTH)) axi4_item; |
|
int unsigned FPW = DATA_BYTES/16; //--FPW: desired Data width in Flits (HMC packet length) valid: 4.6.8 databytes= tdata_width /8 fpw = tdata_width /128 |
int unsigned HEADERS = 1*FPW; |
int unsigned TAILS = 2*FPW; |
int unsigned VALIDS = 0; |
|
int unsigned pkts_in_cycle = 0; //-- HMC tails inserted in current AXI4 cycle |
int unsigned header_in_cycle = 0; //-- HMC headers inserted in current AXI4 cycle |
int unsigned valids_in_cycle = 0; |
hmc_packet hmc_pkt; |
|
|
int flit_offset=0; //-- flit offset First flit-> create new axi_item |
tail_header_flit_t current_flit; |
tail_header_flit_t next_flit; |
|
|
//-- create empty vc |
`uvm_create_on(axi4_item, p_sequencer) |
axi4_item.tdata = 0; |
axi4_item.tuser = 0; |
axi4_item.delay = hmc_packets_ready[0].flit_delay / FPW; //-- measured in flits |
|
while (hmc_packets_ready.size() >0 ) begin |
hmc_pkt = hmc_packets_ready.pop_front(); |
pack_hmc_packet(hmc_pkt); |
|
|
//-- write flits 2 axi4_queue |
while( flit_queue.size > 0 ) begin //-- flit queue contains flits |
|
|
current_flit = flit_queue.pop_front(); |
|
if (current_flit[128]) begin //-- If current flit is header |
flit_offset += hmc_pkt.flit_delay; |
end |
|
//-- check if axi4_item is full |
if ((flit_offset >= FPW) || pkts_in_cycle == max_pkts_per_cycle ) begin |
//-- push full axi item to axi4_queue |
`uvm_info(get_type_name(),$psprintf("axi4_item is full (offset = %0d), writing element %0d to queue ", flit_offset, axi4_queue.size()), UVM_MEDIUM) |
|
if (valids_in_cycle != 0) |
axi4_queue.push_back(axi4_item); |
|
//-- create new AXI4 cycle |
`uvm_create_on(axi4_item, p_sequencer) |
axi4_item.tdata = 0; |
axi4_item.tuser = 0; |
|
//-- set AXI4 cycle delay |
axi4_item.delay = (flit_offset / FPW) -1; //-- flit offset contains also empty flits |
if (flit_offset % FPW >0) |
axi4_item.delay += 1; |
|
//-- reset counter |
`uvm_info(get_type_name(),$psprintf("HMC Packets in last cycle: %0d, %0d", pkts_in_cycle, header_in_cycle), UVM_HIGH) |
pkts_in_cycle = 0; //-- reset HMC packet counter in AXI4 Cycle |
header_in_cycle = 0; |
valids_in_cycle = 0; |
`uvm_info(get_type_name(),$psprintf("axi_delay is %0d", axi4_item.delay), UVM_MEDIUM) |
|
//-- reset flit_offset |
flit_offset = 0; |
end |
|
//-- write flit to axi4_item |
for (int i =0;i<128;i++) begin |
axi4_item.tdata[(flit_offset*128)+i] = current_flit[i]; |
end |
|
//-- Write tuser flags |
//-- write valid |
axi4_item.tuser[VALIDS +flit_offset] = current_flit[130]; //-- valid [fpw-1:0] |
//-- write header |
axi4_item.tuser[HEADERS +flit_offset] = current_flit[128]; //-- only 1 if header |
//-- write tail |
axi4_item.tuser[TAILS +flit_offset] = current_flit[129]; //-- only 1 if tail |
|
valids_in_cycle ++; |
|
|
if(current_flit[129]) begin //-- count tails in current cycle |
pkts_in_cycle ++; |
end |
|
if(current_flit[128]) begin //-- count headers in current cycle |
header_in_cycle ++; |
end |
|
//-- debugging output |
if(current_flit[128]) begin |
`uvm_info(get_type_name(),$psprintf("FLIT is header at pos %d", flit_offset), UVM_MEDIUM) |
end |
if(current_flit[129]) begin |
`uvm_info(get_type_name(),$psprintf("FLIT is tail at pos %d", flit_offset), UVM_MEDIUM) |
end |
|
flit_offset++; |
end |
end |
//-- push last axi4_item to axi4_queue |
axi4_queue.push_back(axi4_item); |
|
endfunction : hmc_packet_2_axi_cycles |
|
|
task aquire_tags(); |
for (int i = working_pos; i < hmc_items.size(); i++) begin //-- get a tag for each packet |
//-- only register a tag if response required! |
if (hmc_items[i].get_command_type() == HMC_WRITE_TYPE || |
hmc_items[i].get_command_type() == HMC_MISC_WRITE_TYPE || |
hmc_items[i].get_command_type() == HMC_READ_TYPE || |
hmc_items[i].get_command_type() == HMC_MODE_READ_TYPE) |
begin |
p_sequencer.handler.get_tag(tag); |
end else begin |
tag = 0; |
end |
|
hmc_items[i].tag = tag; |
|
//-- move packet to ready queue if tag valid |
if (tag >= 0) begin |
|
`uvm_info(get_type_name(),$psprintf("Tag for HMC Packet Type %0d is: %0d", hmc_items[i].get_command_type(), hmc_items[i]), UVM_HIGH) |
hmc_packets_ready.push_back(hmc_items[i]); |
working_pos = i+1; |
end else begin |
break; //-- send all already processed AXI4 Cycles if tag_handler can not provide an additional tag |
end |
end |
|
endtask : aquire_tags |
|
task send_axi4_cycles(); |
axi4_stream_valid_cycle #(.DATA_BYTES(DATA_BYTES),.TUSER_WIDTH(TUSER_WIDTH)) axi4_item; |
while( axi4_queue.size() > 0 ) begin |
`uvm_info(get_type_name(),$psprintf("axi4_queue contains %0d items", axi4_queue.size()), UVM_MEDIUM) |
|
axi4_item = axi4_queue.pop_front(); |
|
if ((axi4_item.tuser == {{(TUSER_WIDTH){1'b0}}})) begin |
axi4_item.print(); |
`uvm_fatal("AXI4_Master_Driver", "sent an empty cycle") |
end |
`uvm_send(axi4_item); |
|
`uvm_info(get_type_name(),$psprintf("\n%s", axi4_item.sprint()), UVM_HIGH) |
end |
|
|
endtask : send_axi4_cycles |
|
task body(); |
|
`uvm_info(get_type_name(),$psprintf("HMC Packets to send: %0d", hmc_items.size()), UVM_MEDIUM) |
|
while (hmc_items.size-1 >= working_pos)begin //-- cycle until all hmc_packets have been sent |
//-- try to aquire a tag for each non posted packet |
aquire_tags(); |
|
//-- send all packets with tags |
if (hmc_packets_ready.size()>0) begin |
|
//-- generate axi4_queue |
hmc_packet_2_axi_cycles(); |
|
//-- send axi4_queue |
send_axi4_cycles(); |
end |
end |
endtask : body |
|
endclass : hmc_2_axi4_sequence |
|
`endif // HMC_2_AXI4_SEQUENCE_SV |
|
/common/src/hmc_2_axi4_sequencer.sv
0,0 → 1,70
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
// |
// |
// hmc_2_axi4_sequencer |
// |
// |
|
`ifndef HMC_2_AXI4_SEQUENCER_SV |
`define HMC_2_AXI4_SEQUENCER_SV |
|
typedef class hmc_2_axi4_sequence; |
|
class hmc_2_axi4_sequencer #(parameter DATA_BYTES = 16, parameter TUSER_WIDTH = 16) extends axi4_stream_master_sequencer #(.DATA_BYTES(DATA_BYTES), .TUSER_WIDTH(TUSER_WIDTH)); |
|
tag_handler handler; //-- a tag handler is used to handle tags of non posted packets |
|
`uvm_component_param_utils_begin(hmc_2_axi4_sequencer #(.DATA_BYTES(DATA_BYTES), .TUSER_WIDTH(TUSER_WIDTH))) |
`uvm_field_object(handler, UVM_DEFAULT) |
`uvm_component_utils_end |
function new (string name = "hmc_2_axi4_sequencer", uvm_component parent); |
super.new(name, parent); |
|
endfunction : new |
|
|
function void build_phase(uvm_phase phase); |
handler = tag_handler::type_id::create("handler", this); |
endfunction : build_phase |
endclass : hmc_2_axi4_sequencer |
|
`endif // HMC_2_AXI4_SEQUENCER_SV |
|
/uvc/build/ncsim.tcl
0,0 → 1,23
database -open waves -into waves.shm -default |
|
probe -create tb_top.dut_I -depth all -tasks -functions -all -database waves |
probe -create tb_top.dut_I.openhmc_instance.rx_link_I -all -database waves -memories |
probe -create tb_top.dut_I.openhmc_instance.tx_link_I -all -database waves -memories |
|
probe -create tb_top.axi4_hmc_rsp_if -all -database waves |
probe -create tb_top.axi4_hmc_req_if -all -database waves |
probe -create tb_top.hmc_if -all -database waves |
probe -create tb_top.hmc_int_if -all -database waves |
|
|
set assert_output_stop_level failed |
set assert_report_incompletes 0 |
|
#-- enable IDA probes |
#ida_database -open -name=ida.db -compress |
#ida_probe -log=on |
#ida_probe -wave=on |
#ida_probe -sv_flow=on |
|
run |
|
/uvc/build/compile_ius_openhmc_behavioral_uvc.f
0,0 → 1,53
# |
# .--------------. .----------------. .------------. |
# | .------------. | .--------------. | .----------. | |
# | | ____ ____ | | | ____ ____ | | | ______ | | |
# | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
# ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
# / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
# (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
# \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
# | | | | | | | | | | | | |
# |_| | '------------' | '--------------' | '----------' | |
# '--------------' '----------------' '------------' |
# |
# openHMC - An Open Source Hybrid Memory Cube Controller |
# (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
# www.ziti.uni-heidelberg.de |
# B6, 26 |
# 68159 Mannheim |
# Germany |
# |
# Contact: openhmc@ziti.uni-heidelberg.de |
# http://ra.ziti.uni-heidelberg.de/openhmc |
# |
# This source file is free software: you can redistribute it and/or modify |
# it under the terms of the GNU Lesser General Public License as published by |
# the Free Software Foundation, either version 3 of the License, or |
# (at your option) any later version. |
# |
# This source file is distributed in the hope that it will be useful, |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
# GNU Lesser General Public License for more details. |
# |
# You should have received a copy of the GNU Lesser General Public License |
# along with this source file. If not, see <http://www.gnu.org/licenses/>. |
# |
# |
|
+define+HMC_UVC |
|
###Include Sources |
#Behavioral serializer and routing models |
-f ${OPENHMC_SIM}/tb/common/src/serdes/behavioral/serdes_behavioral.f |
|
#Source top TB, HW, and DUT |
+incdir+${OPENHMC_SIM}/UVC/hmc/sv |
+incdir+${OPENHMC_SIM}/tb/uvc/src |
-f ${OPENHMC_SIM}/tb/common/build/compile_tb_openhmc.f |
+incdir+${OPENHMC_SIM}/tb/uvc/testlib |
-f ${OPENHMC_SIM}/tb/common/build/compile_hw_openhmc.f |
#${OPENHMC_SIM}/tb/uvc/src/hmc_tb.sv |
${OPENHMC_SIM}/tb/uvc/src/tb_top.sv |
${OPENHMC_SIM}/tb/uvc/src/targets/dut_openhmc_behavioral_uvc.sv |
/uvc/testlib/hmc_base_test.sv
0,0 → 1,152
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
`ifndef hmc_BASE_TEST_SV |
`define hmc_BASE_TEST_SV |
|
class hmc_base_test extends uvm_test; |
|
hmc_tb hmc_tb0; |
axi4_stream_config axi4_req_config; |
axi4_stream_config axi4_rsp_config; |
|
hmc_link_config link_cfg; |
//hmc_link_config link_cfg; |
|
uvm_table_printer printer; |
|
function new(string name="hmc_base_test", uvm_component parent=null); |
super.new(name,parent); |
endfunction : new |
|
virtual function void build_phase(uvm_phase phase); |
super.build_phase(phase); |
|
//-- create config |
|
|
//-- AXI4 request config |
axi4_req_config = axi4_stream_config::type_id::create("axi4_req_config", this); |
axi4_req_config.master_active = UVM_ACTIVE; |
axi4_req_config.slave_active = UVM_PASSIVE; |
axi4_req_config.open_rsp_mode = UVM_PASSIVE; |
|
uvm_report_info(get_type_name(), $psprintf("Setting the axi4_req config:\n"), UVM_LOW); |
uvm_config_db#(axi4_stream_config)::set(this, "hmc_tb0", "axi4_req_config", axi4_req_config); |
|
//-- AXI4 response config |
axi4_rsp_config = axi4_stream_config::type_id::create("axi4_rsp_config", this); |
axi4_rsp_config.master_active = UVM_PASSIVE; |
axi4_rsp_config.slave_active = UVM_ACTIVE; |
axi4_rsp_config.open_rsp_mode = `OPEN_RSP_MODE==1 ? UVM_ACTIVE : UVM_PASSIVE; |
|
uvm_report_info(get_type_name(), $psprintf("Setting the axi4_rsp config:\n"), UVM_LOW); |
uvm_config_db#(axi4_stream_config)::set(this, "hmc_tb0", "axi4_rsp_config", axi4_rsp_config); |
|
//-- HMC link config |
link_cfg = hmc_link_config::type_id::create("link_config", this); |
|
link_cfg.cfg_rsp_open_loop = `OPEN_RSP_MODE==1 ? UVM_ACTIVE : UVM_PASSIVE; |
link_cfg.fpw = `FPW; |
|
//-- hmc_uvc_config |
link_cfg.requester.width = 2**`LOG_NUM_LANES; |
link_cfg.requester.active = UVM_PASSIVE;//`HMC_REQUESTER_IS_ACTIVE; |
link_cfg.requester.requester = 1; |
|
link_cfg.responder.width = 2**`LOG_NUM_LANES; |
link_cfg.responder.active = UVM_ACTIVE;//`HMC_RESPONDER_IS_ACTIVE; |
link_cfg.responder.requester = 0; |
|
link_cfg_randomize : assert (link_cfg.randomize()); |
|
uvm_report_info(get_type_name(), $psprintf("Setting the hmc uvc link config:\n"), UVM_LOW); |
uvm_config_db#(hmc_link_config)::set(this, "hmc_tb0", "link_cfg", link_cfg); |
|
|
set_config_int("*", "recording_detail", UVM_FULL); |
|
//-- create the testbench |
hmc_tb0 = hmc_tb#()::type_id::create("hmc_tb0", this); |
|
|
endfunction : build_phase |
|
function void end_of_elaboration_phase(uvm_phase phase); |
super.end_of_elaboration_phase(phase); |
printer = new(); |
printer.knobs.depth = 5; |
|
`uvm_info(get_type_name(), $psprintf("Printing hmc_config: %s",link_cfg.sprint()), UVM_NONE) |
`uvm_info(get_type_name(), $psprintf("Printing Requester Link config: %s", link_cfg.requester.sprint()), UVM_NONE) |
`uvm_info(get_type_name(), $psprintf("Printing Responder Link config: %s", link_cfg.responder.sprint()), UVM_NONE) |
uvm_report_info(get_type_name(), $psprintf("Printing the test topology :\n%s", this.sprint(printer)), UVM_HIGH); |
|
endfunction : end_of_elaboration_phase |
|
|
virtual task run_phase(uvm_phase phase); |
phase.phase_done.set_drain_time(this, 10us); |
endtask : run_phase |
|
endclass : hmc_base_test |
|
|
class hmc_base_seq extends uvm_sequence; |
|
function new(string name="hmc_base_seq"); |
super.new(name); |
endfunction : new |
|
`uvm_object_utils(hmc_base_seq) |
`uvm_declare_p_sequencer(vseqr) |
|
virtual task pre_body(); |
if(starting_phase != null) |
starting_phase.raise_objection(this); |
endtask : pre_body |
|
virtual task post_body(); |
if(starting_phase != null) |
starting_phase.drop_objection(this); |
endtask : post_body |
|
endclass : hmc_base_seq |
|
`endif // hmc_BASE_TEST_SV |
/uvc/testlib/hmc_model_init_seq.sv
0,0 → 1,61
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
`ifndef HMC_MODEL_INIT_SEQ |
`define HMC_MODEL_INIT_SEQ |
|
class hmc_model_init_seq extends hmc_base_seq; |
|
function new(string name="hmc_model_init_seq"); |
super.new(name); |
endfunction : new |
|
`uvm_object_utils(hmc_model_init_seq) |
`uvm_declare_p_sequencer(vseqr) |
|
task body(); |
|
`uvm_info(get_type_name(), $psprintf("HMC_Token Count is: %d", p_sequencer.link_cfg.hmc_tokens), UVM_NONE) |
`uvm_info(get_type_name(), $psprintf("RX_Token Count is: %d", p_sequencer.link_cfg.rx_tokens), UVM_NONE) |
|
endtask : body |
|
endclass : hmc_model_init_seq |
|
`endif // HMC_MODEL_INIT_SEQ |
/uvc/testlib/openhmc_init_seq.sv
0,0 → 1,143
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
`ifndef OPENHMC_INIT_SEQ |
`define OPENHMC_INIT_SEQ |
|
class openhmc_init_seq extends hmc_base_seq; |
|
// hmc_link_config link_config; |
|
function new(string name="openhmc_init_seq"); |
super.new(name); |
endfunction : new |
|
`uvm_object_utils(openhmc_init_seq) |
`uvm_declare_p_sequencer(vseqr) |
|
bit phy_tx_ready = 1'b0; |
bit phy_rx_ready = 1'b0; |
bit link_up = 1'b0; |
int timeout = 0; |
int delay; |
|
task body(); |
|
//-- configure the HMC controller |
reg_openhmc_rf_control_c control; |
reg_openhmc_rf_status_general_c status; |
reg_openhmc_rf_status_init_c status_init; |
reg_openhmc_rf_counter_reset_c cnt_reset; |
|
`uvm_info(get_type_name(), "Running init sequence", UVM_NONE) |
|
$cast(control,p_sequencer.rf_seqr_hmc.get_by_name("control")); |
control.set_check_on_read(1'b0); |
p_sequencer.rf_seqr_hmc.read_reg(control); |
|
control.fields.rx_token_count_ = p_sequencer.link_cfg.rx_tokens; |
control.fields.scrambler_disable_ = ~p_sequencer.link_cfg.scramblers_enabled; |
control.fields.bit_slip_time_ = 40; |
control.fields.set_hmc_sleep_ = 0; |
control.fields.run_length_enable_ = ~p_sequencer.link_cfg.scramblers_enabled; |
control.fields.irtry_to_send_ = p_sequencer.link_cfg.requester.irtry_flit_count_to_send; |
control.fields.irtry_received_threshold_ = p_sequencer.link_cfg.requester.irtry_flit_count_received_threshold; |
|
p_sequencer.rf_seqr_hmc.write_reg(control); |
|
//Dummy Read to status init |
$cast(status_init,p_sequencer.rf_seqr_hmc.get_by_name("status_init")); |
status_init.set_check_on_read(1'b0); |
p_sequencer.rf_seqr_hmc.read_reg(status_init); |
|
//Dummy counter reset |
$cast(cnt_reset,p_sequencer.rf_seqr_hmc.get_by_name("counter_reset")); |
cnt_reset.fields.rreinit_ = 1; |
p_sequencer.rf_seqr_hmc.write_reg(cnt_reset); |
|
//-- Wait until the PHY is out of reset |
$cast(status,p_sequencer.rf_seqr_hmc.get_by_name("status_general")); |
status.set_check_on_read(1'b0); |
while (phy_tx_ready == 1'b0) |
begin |
#1us; |
p_sequencer.rf_seqr_hmc.read_reg(status); |
phy_tx_ready = status.fields.phy_tx_ready_; |
`uvm_info(get_type_name(), "Waiting for the PHY TX to get ready", UVM_NONE) |
end |
`uvm_info(get_type_name(), "Phy TX ready", UVM_NONE) |
|
//------------------------------------------------------- Set Reset and Init Continue |
control.fields.p_rst_n_ = 1; |
p_sequencer.rf_seqr_hmc.write_reg(control); |
#1us; |
|
control.fields.hmc_init_cont_set_ = 1; |
p_sequencer.rf_seqr_hmc.write_reg(control); |
`uvm_info(get_type_name(), "Init cont in RF set", UVM_NONE) |
|
//------------------------------------------------------- Wait for the PHY to get ready |
while (phy_rx_ready == 1'b0) |
begin |
#1us; |
p_sequencer.rf_seqr_hmc.read_reg(status); |
phy_rx_ready = status.fields.phy_rx_ready_; |
`uvm_info(get_type_name(), "Waiting for PHY RX to get ready", UVM_NONE) |
end |
`uvm_info(get_type_name(), "Phy RX is ready", UVM_NONE) |
|
//-- Poll on link_up to make sure that it comes up. |
while (link_up == 1'b0) |
begin |
if (timeout == 8000) //-- Try Resetting it. |
begin |
`uvm_fatal(get_type_name(), "The link didn't come up...") |
end |
#4ns; |
p_sequencer.rf_seqr_hmc.read_reg(status); |
link_up = status.fields.link_up_; |
timeout = timeout + 1; |
end |
`uvm_info(get_type_name(), "Link is UP !", UVM_NONE) |
|
endtask : body |
|
endclass : openhmc_init_seq |
|
`endif // OPENHMC_INIT_SEQ |
/uvc/src/hmc_tb.sv
0,0 → 1,202
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
`ifndef hmc_TB_SV |
`define hmc_TB_SV |
|
class hmc_tb #( parameter AXI4_DATA_BYTES=`AXI4BYTES, parameter AXI4_TUSER_WIDTH=`AXI4BYTES, parameter NUM_LANES=2**`LOG_NUM_LANES) extends uvm_env; |
//-- UVCs |
|
axi4_stream_env #( |
.DATA_BYTES(AXI4_DATA_BYTES), |
.TUSER_WIDTH(AXI4_TUSER_WIDTH) |
|
) axi4_req; |
|
axi4_stream_env #( |
.DATA_BYTES(AXI4_DATA_BYTES), |
.TUSER_WIDTH(AXI4_TUSER_WIDTH) |
|
) axi4_rsp; |
|
hmc_env # (.NUM_LANES(NUM_LANES))hmc; |
|
hmc_module_env hmc_module; |
|
axi4_stream_config axi4_rsp_config; |
axi4_stream_config axi4_req_config; |
|
hmc_link_config link_cfg; |
|
cag_rgm_rfs_env #( |
.ADDR_WIDTH(`RFS_OPENHMC_RF_AWIDTH), |
.READ_DATA_WIDTH(`RFS_OPENHMC_RF_RWIDTH), |
.WRITE_DATA_WIDTH(`RFS_OPENHMC_RF_WWIDTH) |
) rfs_hmc_I; |
|
rf_openhmc_rf_c rf_model_hmc; |
|
vseqr v_seqr; |
|
int i = 2; |
|
`uvm_component_param_utils(hmc_tb #(.AXI4_DATA_BYTES(AXI4_DATA_BYTES), .AXI4_TUSER_WIDTH(AXI4_TUSER_WIDTH), .NUM_LANES(NUM_LANES) )) |
|
function new (string name="hmc_tb", uvm_component parent=null); |
super.new(name,parent); |
endfunction : new |
|
virtual function void build_phase(uvm_phase phase); |
|
//-- factory overrides |
|
set_inst_override_by_type("axi4_req.master.sequencer", |
axi4_stream_master_sequencer #( .DATA_BYTES(AXI4_DATA_BYTES), .TUSER_WIDTH(AXI4_TUSER_WIDTH) |
)::get_type(), |
hmc_2_axi4_sequencer #( .DATA_BYTES(AXI4_DATA_BYTES), |
.TUSER_WIDTH(AXI4_TUSER_WIDTH) |
)::get_type() |
|
); |
|
set_inst_override_by_type("hmc_module.axi4_req_mon", |
hmc_module_mon::get_type(), |
axi4_stream_hmc_monitor #( .DATA_BYTES(AXI4_DATA_BYTES), |
.TUSER_WIDTH(AXI4_TUSER_WIDTH))::get_type() |
|
); |
set_inst_override_by_type("hmc_module.axi4_rsp_mon", |
hmc_module_mon::get_type(), |
axi4_stream_hmc_monitor #( .DATA_BYTES(AXI4_DATA_BYTES), |
.TUSER_WIDTH(AXI4_TUSER_WIDTH))::get_type() |
|
); |
|
super.build_phase(phase); |
|
//-- deploy configuration |
if (!uvm_config_db#(axi4_stream_config)::get(this, "", "axi4_req_config", axi4_req_config)) begin |
uvm_report_fatal(get_type_name(), $psprintf("axi4_config not set via config_db")); |
end else begin |
uvm_config_db#(axi4_stream_config)::set(this, "axi4_req", "axi4_stream_cfg", axi4_req_config); |
end |
|
if (!uvm_config_db#(axi4_stream_config)::get(this, "", "axi4_rsp_config", axi4_rsp_config)) begin |
uvm_report_fatal(get_type_name(), $psprintf("axi4_config not set via config_db")); |
end else begin |
uvm_config_db#(axi4_stream_config)::set(this, "axi4_rsp", "axi4_stream_cfg", axi4_rsp_config); |
end |
|
|
//hmc link uvc |
if (!uvm_config_db#(hmc_link_config)::get(this, "", "link_cfg", link_cfg)) begin |
uvm_report_fatal(get_type_name(), $psprintf("hmc_link_uvc_config not set via config_db")); |
end else begin |
uvm_config_db#(hmc_link_config)::set(this, "v_seqr", "link_cfg", link_cfg); |
|
uvm_config_db#(hmc_link_config)::set(this, "hmc", "link_config", link_cfg); |
|
end |
|
//-- create instances |
hmc = hmc_env #(.NUM_LANES(NUM_LANES))::type_id::create("hmc",this); |
|
|
axi4_req = axi4_stream_env #(.DATA_BYTES(AXI4_DATA_BYTES),.TUSER_WIDTH(AXI4_TUSER_WIDTH))::type_id::create("axi4_req",this); |
axi4_rsp = axi4_stream_env #(.DATA_BYTES(AXI4_DATA_BYTES),.TUSER_WIDTH(AXI4_TUSER_WIDTH))::type_id::create("axi4_rsp",this); |
|
hmc_module = hmc_module_env::type_id::create("hmc_module",this); |
|
rfs_hmc_I = cag_rgm_rfs_env #(.ADDR_WIDTH(`RFS_OPENHMC_RF_AWIDTH), .READ_DATA_WIDTH(`RFS_OPENHMC_RF_RWIDTH),.WRITE_DATA_WIDTH(`RFS_OPENHMC_RF_WWIDTH))::type_id::create("rfs_hmc_I", this); |
rf_model_hmc = rf_openhmc_rf_c::type_id::create("rf_model_hmc",this); |
|
v_seqr = vseqr::type_id::create("v_seqr", this); |
|
endfunction : build_phase |
|
function void connect_phase(uvm_phase phase); |
|
hmc_2_axi4_sequencer #(.DATA_BYTES(AXI4_DATA_BYTES),.TUSER_WIDTH(AXI4_TUSER_WIDTH)) axi4_req_seqr; |
|
axi4_stream_hmc_monitor #(.DATA_BYTES(AXI4_DATA_BYTES), .TUSER_WIDTH(AXI4_TUSER_WIDTH) ) axi4_hmc_req_mon; |
axi4_stream_hmc_monitor #(.DATA_BYTES(AXI4_DATA_BYTES), .TUSER_WIDTH(AXI4_TUSER_WIDTH) ) axi4_hmc_rsp_mon; |
|
super.connect_phase(phase); |
rfs_hmc_I.assign_vi(tb_top.rfs_hmc_if); |
rfs_hmc_I.set_rf(rf_model_hmc); |
|
//-- cast sequencer |
if ( !$cast(axi4_req_seqr, axi4_req.master.sequencer)) |
`uvm_fatal(get_type_name(), $psprintf("error in seqr cast")); |
|
//-- cast AXI4 to HMC pkt monitors |
if ( !$cast(axi4_hmc_req_mon, hmc_module.axi4_req_mon)) |
`uvm_fatal(get_type_name(), $psprintf("error in axi4_req_mon cast")); |
if ( !$cast(axi4_hmc_rsp_mon, hmc_module.axi4_rsp_mon)) |
`uvm_fatal(get_type_name(), $psprintf("error in axi4_rsp_mon cast")); |
|
axi4_req.master.sequencer = axi4_req_seqr; |
|
//-- connect the AXI4 UVC UVM analysis ports to the corresponding Module UVC monitors |
axi4_req.monitor.item_collected_port.connect(axi4_hmc_req_mon.axi4_port); |
axi4_rsp.monitor.item_collected_port.connect(axi4_hmc_rsp_mon.axi4_port); |
|
//-- connect the AXi4 to HMC pkt response monitor to the tag handler |
axi4_hmc_rsp_mon.item_collected_port.connect(axi4_req_seqr.handler.hmc_rsp_port); |
|
//-- virtual sequencer |
v_seqr.axi4_req_seqr = axi4_req_seqr; |
v_seqr.rf_seqr_hmc = rfs_hmc_I.sequencer; |
|
//--hmc monitor to scb |
hmc.req_transaction_mon.transaction_finished_port.connect(hmc_module.scb.hmc_req_port); //--direkt |
hmc.rsp_transaction_mon.transaction_finished_port.connect(hmc_module.scb.hmc_rsp_port); |
|
|
v_seqr.scb = hmc_module.scb; |
|
endfunction : connect_phase |
|
function void extract_phase(uvm_phase phase); |
link_cfg.responder.config_cg.sample(); |
endfunction : extract_phase |
|
endclass : hmc_tb |
|
`endif // hmc_TB_SV |
/uvc/src/targets/dut_openhmc_behavioral_uvc.sv
0,0 → 1,244
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
`default_nettype none |
`timescale 100ps/1ps |
|
module dut #( |
//*************************Don't touch! Control the design with arguments when executing run.sh |
parameter LOG_NUM_LANES = `LOG_NUM_LANES, |
parameter NUM_LANES = 2**LOG_NUM_LANES, |
parameter LOG_FPW = `LOG_FPW, |
parameter FPW = `FPW, |
parameter DWIDTH = 128*FPW, |
parameter NUM_DATA_BYTES = 16*FPW, |
parameter LANE_WIDTH = DWIDTH / NUM_LANES |
//************************* |
) |
( |
//AXI4 user clock |
input wire clk_user, |
//125MHz reference clock |
input wire clk_hmc_refclk, |
//Global reset |
input wire res_n, |
|
//HMC Link interface |
hmc_sr_if hmc, |
//AXI4 interface ports |
axi4_stream_if axi4_req, |
axi4_stream_if axi4_rsp, |
|
//Register File interface |
cag_rgm_rfs_if rfs_hmc |
); |
|
//----------------------------- Wiring openHMC controller |
wire [DWIDTH-1:0] to_serializers; |
wire [DWIDTH-1:0] from_deserializers; |
wire [NUM_LANES-1:0] bit_slip; |
wire [NUM_LANES-1:0] phy_lane_polarity; |
bit phy_rx_ready; |
bit P_RST_N; |
//If transceiver models are used, clk_hmc should be sourced from the transceiver outclock and res_n hmc can be set independently |
wire clk_hmc = clk_user; |
wire res_n_hmc = res_n; |
|
// Wire the HMC BFM model |
wire LxRXPS; // HMC input |
wire LxTXPS; // HMC output |
wire FERR_N; // HMC output |
wire LxTXPS_pullup; |
assign LxTXPS_pullup = (LxTXPS === 1'bz) ? 1'b1 : LxTXPS; |
wire FERR_N_pullup; |
assign FERR_N_pullup = (FERR_N === 1'bz) ? 1'b1 : FERR_N; |
|
//----------------------------- Signal Routing from SerDes to HMC |
wire [NUM_LANES-1:0] serial_Rx; |
wire [NUM_LANES-1:0] serial_Txp; |
|
//----------------------------- Attach the Register File System interface |
assign rfs_hmc_if.clk = clk_hmc; |
assign rfs_hmc_if.res_n = res_n; |
|
//Assign the AXI4 IF |
assign axi4_req.ACLK = (`OPENHMC_ASYNC_FIFOS==0) ? clk_hmc : clk_user; |
assign axi4_rsp.ACLK = (`OPENHMC_ASYNC_FIFOS==0) ? clk_hmc : clk_user; |
assign axi4_req.ARESET_N = (`OPENHMC_ASYNC_FIFOS==0) ? res_n_hmc : res_n; |
assign axi4_rsp.ARESET_N = (`OPENHMC_ASYNC_FIFOS==0) ? res_n_hmc : res_n; |
|
//------------------------------ Attach the HMC Link interface |
assign hmc.REFCLKP = clk_hmc_refclk; |
assign hmc.REFCLKN = ~clk_hmc_refclk; |
assign FERR_N = hmc.FERR_N; |
assign hmc.REFCLK_BOOT = 2'b00; // 00 -> 125 MHz, 01 -> 156.25 MHz, 10 -> 166.67 MHz |
assign hmc.P_RST_N = P_RST_N; |
assign LxTXPS = hmc.TXPS; |
assign hmc.RXPS = LxRXPS; |
|
assign hmc.RXP = NUM_LANES==8 ? {8'h0, serial_Txp[NUM_LANES-1:0]} : serial_Txp; // Controller Tx is Cube Rx |
assign hmc.RXN = ~hmc.RXP;//NUM_LANES==8 ? {8'h0, ~serial_Txp[NUM_LANES-1:0]} : ~serial_Txp; // Controller Tx is Cube Rx |
assign serial_Rx = hmc.TXP; // Controller Rx is Cube Tx |
|
//----------------------------- Generate Clocks |
bit clk_10G; |
generate |
begin : clocking_gen |
initial clk_10G = 1'b1; |
always #0.05ns clk_10G = ~clk_10G; |
end |
endgenerate |
|
//----------------------------- Behavioral SerDes |
bit LxTXPS_synced; |
bit res_n_synced; |
genvar lane; |
generate |
begin : serializers_gen |
|
for (lane=0; lane<NUM_LANES; lane++) begin : behavioral_gen |
serializer #( |
.DWIDTH(LANE_WIDTH) |
) serializer_I ( |
.clk(clk_hmc), |
.res_n(res_n), |
.fast_clk(clk_10G), |
.data_in(to_serializers[lane*LANE_WIDTH+LANE_WIDTH-1:lane*LANE_WIDTH]), |
.data_out(serial_Txp[lane]) |
); |
deserializer #( |
.DWIDTH(LANE_WIDTH) |
) deserializer_I ( |
.clk(clk_hmc), |
.res_n(LxTXPS_synced && res_n), |
.fast_clk(clk_10G), |
.bit_slip(bit_slip[lane]), |
.lane_polarity(phy_lane_polarity[lane]), |
.data_in(serial_Rx[lane]), |
.data_out(from_deserializers[lane*LANE_WIDTH+LANE_WIDTH-1:lane*LANE_WIDTH]) |
); |
end |
end |
endgenerate |
|
always @(LxTXPS) phy_rx_ready <= #500ns LxTXPS; |
always @(posedge clk_hmc) LxTXPS_synced <= LxTXPS; |
|
//===================================================================================================== |
//----------------------------------------------------------------------------------------------------- |
//---------INSTANTIATIONS HERE------------------------------------------------------------------------- |
//----------------------------------------------------------------------------------------------------- |
//===================================================================================================== |
openhmc_top #( |
.LOG_FPW(LOG_FPW), |
.FPW(FPW), |
.LOG_NUM_LANES(LOG_NUM_LANES), |
//Configure the Functionality |
.LOG_MAX_RX_TOKENS(10), //That is max 1023 Tokens |
.LOG_MAX_HMC_TOKENS(10), //That is max 1023 Tokens |
.HMC_RX_AC_COUPLED(1), |
.CTRL_LANE_POLARITY(1), |
.CTRL_LANE_REVERSAL(1), |
.BITSLIP_SHIFT_RIGHT(1), |
.OPEN_RSP_MODE(`OPEN_RSP_MODE), |
.SYNC_AXI4_IF(`OPENHMC_ASYNC_FIFOS==0), |
// Debug Logic |
.DBG_RX_TOKEN_MON(1) //Required by the test check sequence |
) |
openhmc_instance |
( |
|
//---------------------------------- |
//----SYSTEM INTERFACES |
//---------------------------------- |
.clk_user(clk_user), |
.clk_hmc(clk_hmc), |
.res_n_user(res_n), |
.res_n_hmc(res_n), |
|
//---------------------------------- |
//----Connect HMC Controller |
//---------------------------------- |
//to TX |
.s_axis_tx_TVALID(axi4_req.TVALID), |
.s_axis_tx_TREADY(axi4_req.TREADY), |
.s_axis_tx_TDATA(axi4_req.TDATA), |
.s_axis_tx_TUSER(axi4_req.TUSER), |
//from RX |
.m_axis_rx_TVALID(axi4_rsp.TVALID), |
.m_axis_rx_TREADY(axi4_rsp.TREADY), |
.m_axis_rx_TDATA(axi4_rsp.TDATA), |
.m_axis_rx_TUSER(axi4_rsp.TUSER), |
|
//---------------------------------- |
//----Connect Physical Link |
//---------------------------------- |
.phy_data_tx_link2phy(to_serializers), |
.phy_data_rx_phy2link(from_deserializers), |
.phy_bit_slip(bit_slip), |
.phy_tx_ready(res_n), |
.phy_rx_ready(phy_rx_ready && LxTXPS), |
.phy_lane_polarity(phy_lane_polarity), |
.phy_init_cont_set(), |
|
//---------------------------------- |
//----Connect HMC |
//---------------------------------- |
.P_RST_N(P_RST_N), |
.LXRXPS(LxRXPS), |
.LXTXPS(LxTXPS_pullup), |
.FERR_N(FERR_N_pullup), |
|
//---------------------------------- |
//----Connect RF |
//---------------------------------- |
.rf_address(rfs_hmc.address), |
.rf_read_data(rfs_hmc.read_data), |
.rf_invalid_address(rfs_hmc.invalid_address), |
.rf_access_complete(rfs_hmc.access_done), |
.rf_read_en(rfs_hmc.ren), |
.rf_write_en(rfs_hmc.wen), |
.rf_write_data(rfs_hmc.write_data) |
|
); |
|
endmodule : dut |
|
`default_nettype wire |
|
/uvc/src/hmc_vseqr.sv
0,0 → 1,70
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
`ifndef VIRTUAL_SEQUENCER_SV |
`define VIRTUAL_SEQUENCER_SV |
|
class vseqr extends uvm_sequencer; |
|
hmc_link_config link_cfg; |
|
//-- references to testbench sequencers |
cag_rgm_sequencer rf_seqr_hmc; |
|
hmc_module_scb scb; |
|
hmc_2_axi4_sequencer #(.DATA_BYTES(`AXI4BYTES),.TUSER_WIDTH(`AXI4BYTES)) axi4_req_seqr; |
|
`uvm_component_utils_begin(vseqr) |
`uvm_component_utils_end |
|
function new (string name = "hmc_virtual_sequencer", uvm_component parent); |
super.new(name, parent); |
endfunction : new |
|
function void build_phase(uvm_phase phase); |
super.build_phase(phase); |
if (!uvm_config_db#(hmc_link_config)::get(this, "", "link_cfg", link_cfg)) begin |
uvm_report_fatal(get_type_name(), $psprintf("hmc_link_uvc_config not set via config_db")); |
end |
endfunction : build_phase |
|
endclass : vseqr |
|
`endif // VIRTUAL_SEQUENCER_SV |
/uvc/src/tb_top.sv
0,0 → 1,175
/* |
* .--------------. .----------------. .------------. |
* | .------------. | .--------------. | .----------. | |
* | | ____ ____ | | | ____ ____ | | | ______ | | |
* | ||_ || _|| | ||_ \ / _|| | | .' ___ || | |
* ___ _ __ ___ _ __ | | | |__| | | | | | \/ | | | |/ .' \_|| | |
* / _ \| '_ \ / _ \ '_ \ | | | __ | | | | | |\ /| | | | || | | | |
* (_) | |_) | __/ | | || | _| | | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| | |
* \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| | |
* | | | | | | | | | | | | |
* |_| | '------------' | '--------------' | '----------' | |
* '--------------' '----------------' '------------' |
* |
* openHMC - An Open Source Hybrid Memory Cube Controller |
* (C) Copyright 2014 Computer Architecture Group - University of Heidelberg |
* www.ziti.uni-heidelberg.de |
* B6, 26 |
* 68159 Mannheim |
* Germany |
* |
* Contact: openhmc@ziti.uni-heidelberg.de |
* http://ra.ziti.uni-heidelberg.de/openhmc |
* |
* This source file is free software: you can redistribute it and/or modify |
* it under the terms of the GNU Lesser General Public License as published by |
* the Free Software Foundation, either version 3 of the License, or |
* (at your option) any later version. |
* |
* This source file is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* GNU Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public License |
* along with this source file. If not, see <http://www.gnu.org/licenses/>. |
* |
* |
*/ |
|
`include "axi4_stream_pkg.sv" |
`include "hmc_pkg.sv" |
`include "hmc_module_pkg.sv" |
`include "cag_rgm_rfs_if.sv" |
|
|
|
`timescale 100ps/1ps |
|
module tb_top (); |
|
import uvm_pkg::*; |
|
//-- include the UVCs |
import axi4_stream_pkg::*; |
import hmc_pkg::*; |
import hmc_module_pkg::*; |
import hmc_base_types_pkg::*; |
|
`include "cag_rgm.svh" |
|
`ifdef X16 |
`include "register_file_model_16x.sv" |
`else |
`include "register_file_model_8x.sv" |
`endif |
|
`include "hmc_packet.sv" |
`include "hmc_req_packet.sv" |
`include "hmc_2_axi4_sequencer.sv" |
`include "hmc_2_axi4_sequence.sv" |
`include "tag_handler.sv" |
|
`include "hmc_vseqr.sv" |
|
`include "axi4_stream_hmc_monitor.sv" |
|
`include "hmc_tb.sv" |
|
`include "test_lib.sv" |
|
logic res_n, clk_user, clk_hmc_refclk; |
|
//-- instantiate the interfaces |
axi4_stream_if #( |
.DATA_BYTES(`AXI4BYTES), |
.TUSER_WIDTH(`AXI4BYTES) |
) axi4_hmc_req_if(); |
|
axi4_stream_if #( |
.DATA_BYTES(`AXI4BYTES), |
.TUSER_WIDTH(`AXI4BYTES) |
) axi4_hmc_rsp_if(); |
|
cag_rgm_rfs_if #( |
.ADDR_WIDTH(`RFS_OPENHMC_RF_AWIDTH), |
.READ_DATA_WIDTH(`RFS_OPENHMC_RF_RWIDTH), |
.WRITE_DATA_WIDTH(`RFS_OPENHMC_RF_WWIDTH) |
) rfs_hmc_if(); |
|
hmc_sr_if#(.NUM_LANES(2**`LOG_NUM_LANES)) hmc_if(); |
hmc_sr_if#(.NUM_LANES(2**`LOG_NUM_LANES)) hmc_int_if(); |
dut dut_I ( |
.clk_user(clk_user), |
.clk_hmc_refclk(clk_hmc_refclk), |
.res_n(res_n), |
.hmc(hmc_if), |
.axi4_req(axi4_hmc_req_if), |
.axi4_rsp(axi4_hmc_rsp_if), |
|
.rfs_hmc(rfs_hmc_if) |
); |
|
assign hmc_int_if.REFCLK_BOOT = hmc_if.REFCLK_BOOT; |
assign hmc_int_if.REFCLKN = hmc_if.REFCLKN; |
assign hmc_int_if.REFCLKP = hmc_if.REFCLKP; |
assign hmc_int_if.P_RST_N = hmc_if.P_RST_N; |
assign hmc_int_if.RXPS = hmc_if.RXPS; |
|
assign hmc_if.TXPS = hmc_int_if.TXPS; |
assign hmc_if.FERR_N = hmc_int_if.FERR_N; |
initial begin |
|
uvm_config_db#(virtual axi4_stream_if #(.DATA_BYTES(`AXI4BYTES), .TUSER_WIDTH(`AXI4BYTES)))::set(null, "uvm_test_top.hmc_tb0.axi4_req", "vif", axi4_hmc_req_if); |
uvm_config_db#(virtual axi4_stream_if #(.DATA_BYTES(`AXI4BYTES), .TUSER_WIDTH(`AXI4BYTES)))::set(null, "uvm_test_top.hmc_tb0.axi4_rsp", "vif", axi4_hmc_rsp_if); |
|
//hmc_link interfaces |
uvm_config_db#(virtual hmc_sr_if#(.NUM_LANES(2**`LOG_NUM_LANES)))::set(null, "uvm_test_top.hmc_tb0.hmc", "vif", hmc_if); |
uvm_config_db#(virtual hmc_sr_if#(.NUM_LANES(2**`LOG_NUM_LANES)))::set(null, "uvm_test_top.hmc_tb0.hmc", "int_vif", hmc_int_if); |
|
run_test(); |
end |
|
initial begin |
clk_user <= 1'b1; |
clk_hmc_refclk <= 1'b1; |
res_n <= 1'b0; |
#500ns; |
@(posedge clk_user) res_n <= 1'b1; |
end |
|
//-- Generate the user clock |
always begin |
case(`FPW) |
2: begin |
if(`LOG_NUM_LANES==3) //8lanes |
#1.6ns clk_user = !clk_user; |
else begin |
#0.8ns clk_user = !clk_user; |
end |
end |
4: begin |
if(`LOG_NUM_LANES==3) //8lanes |
#3.2ns clk_user = !clk_user; |
else |
#1.6ns clk_user = !clk_user; |
end |
6: begin |
if(`LOG_NUM_LANES==3) //8lanes |
#4.8ns clk_user = !clk_user; |
else |
#2.4ns clk_user = !clk_user; |
end |
8: begin |
if(`LOG_NUM_LANES==3) //8lanes |
#6.4ns clk_user = !clk_user; |
else |
#3.2ns clk_user = !clk_user; |
end |
endcase |
end |
|
//-- 125 MHz HMC/Transceiver refclock |
always #4ns clk_hmc_refclk <= ~clk_hmc_refclk; |
|
endmodule : tb_top |