URL
https://opencores.org/ocsvn/qaz_libs/qaz_libs/trunk
Subversion Repositories qaz_libs
Compare Revisions
- This comparison shows the changes necessary to convert path
/qaz_libs/trunk/PCIe/sim
- from Rev 37 to Rev 39
- ↔ Reverse comparison
Rev 37 → Rev 39
/src/riffa_agent_class_pkg.sv
40,7 → 40,6
riffa_transaction_class #(N) tr_h; |
rp_tx_bfm_class #(N) tx_h; |
rp_rx_bfm_class #(N) rx_h; |
// mailbox #(riffa_transaction_class #(N)) tx_q, rx_q; |
mailbox #(riffa_transaction_class #(N)) tx_q; |
|
|
72,6 → 71,15
|
// -------------------------------------------------------------------- |
// |
task queue_tx_hex(string str, int off, bit last); |
tr_h = new(1, off, last); |
tr_h.hex(str, off, last); |
queue_tx(tr_h); |
endtask: queue_tx_hex |
|
|
// -------------------------------------------------------------------- |
// |
task queue_tx_random(int len, int off, bit last); |
tr_h = new(len, off, last); |
tr_h.random(len, off, last); |
84,7 → 92,6
task queue_rx(int len, int off, bit last); |
tr_h = new(len, off, last); |
rx_h.put(tr_h); |
// rx_q.put(tr_h); |
endtask: queue_rx |
|
|
108,7 → 115,6
tx_h = new(chnl_bus); |
rx_h = new(chnl_bus); |
this.tx_q = new; |
// this.rx_q = new; |
endfunction: new |
|
|
/src/riffa_bfm_class_pkg.sv
46,8 → 46,10
//-------------------------------------------------------------------- |
// |
function int get_data_size(int len); |
// int words = $ceil(len/(N/4)); // need to fix |
int words = len/(N/4); |
int words = ((len * 4) % N == 0) ? ((len * 4) / N) : ((len * 4) / N) + 1; |
// $display("^^^ %16.t | N = %d", $time, N); |
// $display("^^^ %16.t | len = %d", $time, len); |
// $display("^^^ %16.t | mod = %d", $time, (len * 4) % N); |
// $display("^^^ %16.t | words = %d", $time, words); |
return(words); |
endfunction: get_data_size |
79,6 → 81,31
|
//-------------------------------------------------------------------- |
// |
function void hex(string str, int off, bit last); |
string rev_str; |
string char; |
int w, c; |
this.len = (str.len() % (2 * 4)) == 0 |
? (str.len() / (2 * 4)) |
: (str.len() / (2 * 4)) + 1; |
this.data = new[get_data_size(this.len)]; |
this.off = off; |
this.last = last; |
rev_str = {<<8{str}}; // reverse string |
for(w = 0; w < rev_str.len(); w += (N * 2)) |
for(c = 0; c < (N * 2); c++) |
begin |
char = string'(rev_str.getc(w + c)); |
if(char == "") |
this.data[w / (N * 2)][(c * 4) +: 4] = 0; |
else |
this.data[w / (N * 2)][(c * 4) +: 4] = char.atohex(); |
end |
endfunction: hex |
|
|
//-------------------------------------------------------------------- |
// |
function void random(int len, int off, bit last); |
this.data = new[get_data_size(len)]; |
assert(this.randomize() with |
252,20 → 279,16
chnl_bus.cb_rp_rx.tx_data_ren <= 1; |
|
fork |
@(chnl_bus.cb_rp_tx) |
@(chnl_bus.cb_rp_rx) |
chnl_bus.cb_rp_rx.tx_ack <= 0; |
join_none |
|
// foreach(tr_h.data[i]) |
// @(chnl_bus.cb_rp_tx) |
// if(~chnl_bus.cb_rp_rx.tx) |
// break; |
// else if(chnl_bus.cb_rp_rx.tx_data_valid) |
// tr_h.data[i] <= chnl_bus.cb_rp_rx.tx_data; |
|
foreach(tr_h.data[i]) |
@(chnl_bus.cb_rp_tx iff chnl_bus.cb_rp_rx.tx_data_valid) |
begin |
@(chnl_bus.cb_rp_rx iff chnl_bus.cb_rp_rx.tx_data_valid) |
tr_h.data[i] <= chnl_bus.cb_rp_rx.tx_data; |
// $display("^^^ %16.t | %d | %h", $time, i, chnl_bus.cb_rp_rx.tx_data); |
end |
|
rx_q.put(tr_h); |
set_default(); |