Skip to content

Commit

Permalink
CVXIF : Moving the cvxif sequence to cva6 env and change it to a vseq…
Browse files Browse the repository at this point in the history
…uence
  • Loading branch information
AyoubJalali committed Mar 29, 2023
1 parent dcf359c commit 8e6969d
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,37 @@
// Original Author: Zineb EL KACIMI ([email protected])


`ifndef __UVMA_CVXIF_BASE_SEQ_SV__
`define __UVMA_CVXIF_BASE_SEQ_SV__
`ifndef __UVME_CVXIF_BASE_VSEQ_SV__
`define __UVME_CVXIF_BASE_VSEQ_SV__


class uvma_cvxif_base_seq_c extends uvm_sequence #(uvma_cvxif_resp_item_c);
class uvme_cvxif_base_vseq_c extends uvm_sequence #(uvma_cvxif_resp_item_c);

`uvm_object_utils (uvma_cvxif_base_seq_c)
`uvm_declare_p_sequencer (uvma_cvxif_sqr_c)
`uvm_object_utils (uvme_cvxif_base_vseq_c)
`uvm_declare_p_sequencer (uvma_cvxif_vsqr_c)

uvma_cvxif_resp_item_c resp_item;
uvma_cvxif_req_item_c req_item;

uvma_cvxif_cfg_c cfg;

string info_tag = "CVXIF_BASE_SEQ";
string info_tag = "CVXIF_BASE_VSEQ";

extern function new(string name="uvma_cvxif_base_seq");
extern function new(string name="uvme_cvxif_base_vseq");

extern virtual task pre_body();

extern function string decode(input logic [31:0] instr);

endclass

function uvma_cvxif_base_seq_c::new(string name="uvma_cvxif_base_seq");
function uvme_cvxif_base_vseq_c::new(string name="uvme_cvxif_base_vseq");

super.new(name);

endfunction : new

task uvma_cvxif_base_seq_c::pre_body();
task uvme_cvxif_base_vseq_c::pre_body();

req_item = uvma_cvxif_req_item_c::type_id::create("req_item");
resp_item = uvma_cvxif_resp_item_c::type_id::create("resp_item");
Expand All @@ -47,7 +47,7 @@ task uvma_cvxif_base_seq_c::pre_body();

endtask

function string uvma_cvxif_base_seq_c::decode(input logic [31:0] instr);
function string uvme_cvxif_base_vseq_c::decode(input logic [31:0] instr);

bit [6:0] opcode = instr [6:0];
bit [6:0] custom3 = 7'b1111011;
Expand Down Expand Up @@ -103,4 +103,4 @@ function string uvma_cvxif_base_seq_c::decode(input logic [31:0] instr);
endfunction


`endif // __UVMA_CVXIF_BASE_SEQ_SV__
`endif // __UVME_CVXIF_BASE_VSEQ_SV__
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@
//
// Original Author: Zineb EL KACIMI ([email protected])

`ifndef __UVMA_CVXIF_SEQ_SV__
`define __UVMA_CVXIF_SEQ_SV__
`ifndef __UVME_CVXIF_VSEQ_SV__
`define __UVME_CVXIF_VSEQ_SV__


class uvma_cvxif_seq_c extends uvma_cvxif_base_seq_c#(uvma_cvxif_resp_item_c);
class uvme_cvxif_vseq_c extends uvme_cvxif_base_vseq_c#(uvma_cvxif_resp_item_c);

`uvm_object_utils (uvma_cvxif_seq_c)
`uvm_declare_p_sequencer (uvma_cvxif_sqr_c)
`uvm_object_utils (uvme_cvxif_vseq_c)
`uvm_declare_p_sequencer (uvma_cvxif_vsqr_c)

string info_tag = "CVXIF_SEQ_RESP";
string info_tag = "CVXIF_VSEQ_RESP";
string instr;

/**
* Default constructor.
*/
extern function new(string name="uvma_cvxif_seq");
extern function new(string name="uvme_cvxif_vseq");

/**
* Send the Sequence Response to the Sequencer.
Expand Down Expand Up @@ -57,7 +57,7 @@ class uvma_cvxif_seq_c extends uvma_cvxif_base_seq_c#(uvma_cvxif_resp_item_c);

endclass

task uvma_cvxif_seq_c::body();
task uvme_cvxif_vseq_c::body();

forever begin
// wait for a transaction request (get is blocking)
Expand Down Expand Up @@ -85,13 +85,13 @@ task uvma_cvxif_seq_c::body();

endtask

function uvma_cvxif_seq_c::new(string name="uvma_cvxif_seq");
function uvme_cvxif_vseq_c::new(string name="uvme_cvxif_vseq");

super.new(name);

endfunction : new

task uvma_cvxif_seq_c::do_default();
task uvme_cvxif_vseq_c::do_default();

resp_item.issue_resp.accept=0;
resp_item.issue_resp.writeback=0;
Expand All @@ -110,7 +110,7 @@ task uvma_cvxif_seq_c::do_default();

endtask

task uvma_cvxif_seq_c::do_issue_resp();
task uvme_cvxif_vseq_c::do_issue_resp();

resp_item.issue_resp.dualwrite = 0;
resp_item.issue_resp.dualread = 0;
Expand Down Expand Up @@ -154,7 +154,7 @@ task uvma_cvxif_seq_c::do_issue_resp();

endtask

task uvma_cvxif_seq_c::do_result_resp();
task uvme_cvxif_vseq_c::do_result_resp();

//result_resp
if (!req_item.commit_req.commit_kill && req_item.commit_valid) begin
Expand Down Expand Up @@ -186,7 +186,7 @@ task uvma_cvxif_seq_c::do_result_resp();

endtask

task uvma_cvxif_seq_c::do_instr_result();
task uvme_cvxif_vseq_c::do_instr_result();

//result response depend on instruction
resp_item.result.exc=0;
Expand Down Expand Up @@ -233,7 +233,7 @@ task uvma_cvxif_seq_c::do_instr_result();

endtask

task uvma_cvxif_seq_c::send_resp(uvma_cvxif_resp_item_c resp);
task uvme_cvxif_vseq_c::send_resp(uvma_cvxif_resp_item_c resp);

resp_item.set_sequencer(p_sequencer);
`uvm_send(resp_item);
Expand Down
8 changes: 4 additions & 4 deletions cva6/env/uvme/uvme_cva6_env.sv
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ endfunction: connect_scoreboard
function void uvme_cva6_env_c::assemble_vsequencer();

vsequencer.clknrst_sequencer = clknrst_agent.sequencer;
vsequencer.cvxif_sequencer = cvxif_agent.sequencer;
vsequencer.cvxif_vsequencer = cvxif_agent.vsequencer;
vsequencer.axi_vsequencer = axi_agent.vsequencer;

endfunction: assemble_vsequencer
Expand All @@ -284,9 +284,9 @@ task uvme_cva6_env_c::run_phase(uvm_phase phase);
fork

begin
uvma_cvxif_seq_c cvxif_seq;
cvxif_seq = uvma_cvxif_seq_c::type_id::create("cvxif_seq");
cvxif_seq.start(cvxif_agent.sequencer);
uvme_cvxif_vseq_c cvxif_vseq;
cvxif_vseq = uvme_cvxif_vseq_c::type_id::create("cvxif_vseq");
cvxif_vseq.start(cvxif_agent.vsequencer);
end

begin
Expand Down
1 change: 1 addition & 0 deletions cva6/env/uvme/uvme_cva6_pkg.flist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
+incdir+${CVA6_UVME_PATH}
+incdir+${CVA6_UVME_PATH}/cov
+incdir+${CVA6_UVME_PATH}/vseq
+incdir+${CVA6_UVME_PATH}/cvxif_vseq

// Files
${CVA6_UVME_PATH}/uvme_cva6_pkg.sv
2 changes: 1 addition & 1 deletion cva6/env/uvme/uvme_cva6_vsqr.sv
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class uvme_cva6_vsqr_c extends uvm_sequencer#(

// Sequencer handles
uvma_clknrst_sqr_c clknrst_sequencer;
uvma_cvxif_sqr_c cvxif_sequencer;
uvma_cvxif_vsqr_c cvxif_vsequencer;
uvma_axi_vsqr_c axi_vsequencer;


Expand Down
14 changes: 7 additions & 7 deletions lib/uvm_agents/uvma_cvxif/src/comps/uvma_cvxif_agent.sv
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class uvma_cvxif_agent_c extends uvm_agent;

// Components
uvma_cvxif_mon_c monitor;
uvma_cvxif_sqr_c sequencer;
uvma_cvxif_vsqr_c vsequencer;
uvma_cvxif_drv_c driver;
uvma_cvxif_cov_model_c cov_model;

Expand Down Expand Up @@ -138,22 +138,22 @@ endfunction : retrieve_vif

function void uvma_cvxif_agent_c::create_components();

monitor = uvma_cvxif_mon_c ::type_id::create("monitor" , this);
sequencer = uvma_cvxif_sqr_c ::type_id::create("sequencer", this);
driver = uvma_cvxif_drv_c ::type_id::create("driver" , this);
cov_model = uvma_cvxif_cov_model_c ::type_id::create("cov_model" , this);
monitor = uvma_cvxif_mon_c ::type_id::create("monitor" , this);
vsequencer = uvma_cvxif_vsqr_c ::type_id::create("vsequencer", this);
driver = uvma_cvxif_drv_c ::type_id::create("driver" , this);
cov_model = uvma_cvxif_cov_model_c ::type_id::create("cov_model" , this);

endfunction : create_components

function void uvma_cvxif_agent_c::connect_sequencer_and_driver();

driver.seq_item_port.connect(sequencer.seq_item_export);
driver.seq_item_port.connect(vsequencer.seq_item_export);

endfunction : connect_sequencer_and_driver

function void uvma_cvxif_agent_c::connect_analysis_ports();

monitor.req_ap.connect(sequencer.mm_req_fifo.analysis_export);
monitor.req_ap.connect(vsequencer.mm_req_fifo.analysis_export);

endfunction : connect_analysis_ports

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,41 @@
// Original Author: Zineb EL KACIMI ([email protected])


`ifndef __UVMA_CVXIF_SQR_SV__
`define __UVMA_CVXIF_SQR_SV__
`ifndef __UVMA_CVXIF_VSQR_SV__
`define __UVMA_CVXIF_VSQR_SV__


/**
* Component provides sequence items for uvma_cvxif_drv_c.
*/
class uvma_cvxif_sqr_c extends uvm_sequencer#(uvma_cvxif_resp_item_c);
class uvma_cvxif_vsqr_c extends uvm_sequencer#(uvma_cvxif_resp_item_c);

// Analysis port to receive retirement events from monitor
uvm_tlm_analysis_fifo #(uvma_cvxif_req_item_c) mm_req_fifo;

// Objects
uvma_cvxif_cfg_c cfg;

`uvm_component_utils_begin (uvma_cvxif_sqr_c)
`uvm_component_utils_begin (uvma_cvxif_vsqr_c)
`uvm_field_object(cfg , UVM_DEFAULT)
`uvm_object_utils_end

/**
* Default constructor.
*/
extern function new(string name="uvma_cvxif_sqr", uvm_component parent=null);
extern function new(string name="uvma_cvxif_vsqr", uvm_component parent=null);

extern virtual function void build_phase(uvm_phase phase);

endclass : uvma_cvxif_sqr_c
endclass : uvma_cvxif_vsqr_c

function uvma_cvxif_sqr_c::new(string name="uvma_cvxif_sqr", uvm_component parent=null);
function uvma_cvxif_vsqr_c::new(string name="uvma_cvxif_vsqr", uvm_component parent=null);

super.new(name, parent);

endfunction : new

function void uvma_cvxif_sqr_c::build_phase(uvm_phase phase);
function void uvma_cvxif_vsqr_c::build_phase(uvm_phase phase);

super.build_phase(phase);

Expand All @@ -56,4 +56,4 @@ function void uvma_cvxif_sqr_c::build_phase(uvm_phase phase);
endfunction : build_phase


`endif // __UVMA_CVXI_SQR_SV__
`endif // __UVMA_CVXIF_VSQR_SV__
1 change: 0 additions & 1 deletion lib/uvm_agents/uvma_cvxif/src/uvma_cvxif_pkg.flist
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
+incdir+${DV_UVMA_CVXIF_PATH}/src/comps
+incdir+${DV_UVMA_CVXIF_PATH}/src/obj
+incdir+${DV_UVMA_CVXIF_PATH}/src/seq
+incdir+${CORE_V_VERIF}/${CV_CORE_LC}/lib/cvxif_seq

// Files
${DV_UVMA_CVXIF_PATH}/src/uvma_cvxif_pkg.sv
8 changes: 4 additions & 4 deletions lib/uvm_agents/uvma_cvxif/src/uvma_cvxif_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ package uvma_cvxif_pkg;

// Agent components
`include "uvma_cvxif_mon.sv"
`include "uvma_cvxif_sqr.sv"
`include "uvma_cvxif_vsqr.sv"
`include "uvma_cvxif_drv.sv"
`include "uvma_cvxif_cov_model.sv"
`include "uvma_cvxif_agent.sv"

// Sequences
`include "uvma_cvxif_base_seq.sv"
`include "uvma_cvxif_seq.sv"
// Virtual Sequences
`include "uvme_cvxif_base_vseq.sv"
`include "uvme_cvxif_vseq.sv"

endpackage : uvma_cvxif_pkg

Expand Down

0 comments on commit 8e6969d

Please sign in to comment.