for (i=2; i <= 2; i = i + 1) begin
if (!(valid_f[i] && status_f[i])) begin
valid_token = `false;
token_number = i;
disable block_get;
end // if
end // loop
valid_token = `true;
wk_cmd[incode1:incode2] = `wakeup_cmd;
end
endtask // get_wakeup_cmd
task get_trigger_cmd;
input [1:`token_size*8*10] inline;
output valid_token;
output [31:0] token_number;
input [31:0] msg_level;
reg valid_f[2:2];
reg status_f[2:2];
reg [1:7*8] cmd_name;
reg [`token_size-1:0] token_2;
integer i;
begin : block_get
valid_f[2] = `false;
status_f[2] = `false;
cmd_name = "TRIGGER";
valid_token = `false;
token_number = 0;
$lmv_tokenize(inline, 0, 0, token_2, status_f[2]);
wk_cmd[intvalue1:intvalue2] = token_2;
valid_f[2] = `true;
for (i=2; i <= 2; i = i + 1) begin
if (!(valid_f[i] && status_f[i])) begin
valid_token = `false;
token_number = i;
disable block_get;
end // if
end // loop
valid_token = `true;
wk_cmd[incode1:incode2] = `trigger_cmd;
end
endtask // get_trigger_cmd
task get_wait_on_cmd;
input [1:`token_size*8*10] inline;
output valid_token;
output [31:0] token_number;
input [31:0] msg_level;
reg valid_f[2:2];
reg status_f[2:2];
reg [1:7*8] cmd_name;
reg [`token_size-1:0] token_2;
integer i;
begin : block_get
valid_f[2] = `false;
status_f[2] = `false;
cmd_name = "WAIT_ON";
valid_token = `false;
token_number = 0;
$lmv_tokenize(inline, 0, 0, token_2, status_f[2]);
wk_cmd[intvalue1:intvalue2] = token_2;
valid_f[2] = `true;
for (i=2; i <= 2; i = i + 1) begin
if (!(valid_f[i] && status_f[i])) begin
valid_token = `false;
token_number = i;
disable block_get;
end // if
end // loop
valid_token = `true;
wk_cmd[incode1:incode2] = `wait_on_cmd;
end
endtask // get_wait_on_cmd
task get_print_msg_cmd;
input [1:`token_size*8*10] inline;
output valid_token;
output [31:0] token_number;
input [31:0] msg_level;
reg valid_f[2:2];
reg status_f[2:2];
reg [1:9*8] cmd_name;
reg [(`token_size-1)*8:0] token_2;
integer i;
begin : block_get
valid_f[2] = `false;
status_f[2] = `false;
cmd_name = "PRINT_MSG";
valid_token = `false;
token_number = 0;
// $lmv_tokenize(inline, 2, 1024, token_2, status_f[2]);
$lmv_tokenize(inline, 1, 1024, token_2, status_f[2]);
wk_cmd[inmessage1:inmessage2] = token_2;
valid_f[2] = `true;
for (i=2; i <= 2; i = i + 1) begin
if (!(valid_f[i] && status_f[i])) begin
valid_token = `false;
token_number = i;
disable block_get;
end // if
end // loop
valid_token = `true;
wk_cmd[incode1:incode2] = `print_msg_cmd;
end
endtask // get_print_msg_cmd
task get_set_msg_level_cmd;
input [1:`token_size*8*10] inline;
output valid_token;
output [31:0] token_number;
input [31:0] msg_level;
reg valid_f[2:2];
reg status_f[2:2];
reg [1:13*8] cmd_name;
reg [`token_size-1:0] token_2;
integer i;
begin : block_get
valid_f[2] = `false;
status_f[2] = `false;
cmd_name = "SET_MSG_LEVEL";
valid_token = `false;
token_number = 0;
$lmv_tokenize(inline, 1, 0, token_2, status_f[2]);
pcl_to_msg_level(wk_cmd[inmlevel1:inmlevel2],token_2,valid_f[2],msg_level,cmd_name);
for (i=2; i <= 2; i = i + 1) begin
if (!(valid_f[i] && status_f[i])) begin
valid_token = `false;
token_number = i;
disable block_get;
end // if
end // loop
valid_token = `true;
wk_cmd[incode1:incode2] = `set_msg_level_cmd;
end
endtask // get_set_msg_level_cmd
task get_call_cmd;
input [1:`token_size*8*10] inline;
output valid_token;
output [31:0] token_number;
input [31:0] msg_level;
reg valid_f[2:2];
reg status_f[2:2];
reg [1:4*8] cmd_name;
reg [(`token_size-1)*8:0] token_2;
integer i;
begin : block_get
valid_f[2] = `false;
status_f[2] = `false;
cmd_name = "CALL";
valid_token = `false;
token_number = 0;
$lmv_tokenize(inline, 1, 1024, token_2, status_f[2]);
wk_cmd[infunction_name1:infunction_name2] = token_2;
valid_f[2] = `true;
for (i=2; i <= 2; i = i + 1) begin
if (!(valid_f[i] && status_f[i])) begin
valid_token = `false;
token_number = i;
disable block_get;
end // if
end // loop
valid_token = `true;
wk_cmd[incode1:incode2] = `call_cmd;
end
endtask // get_call_cmd
task get_func_beg_cmd;
input [1:`token_size*8*10] inline;
output valid_token;
output [31:0] token_number;
input [31:0] msg_level;
reg valid_f[2:2];
reg status_f[2:2];
reg [1:8*8] cmd_name;
reg [(`token_size-1)*8:0] token_2;
integer i;
begin : block_get
valid_f[2] = `false;
status_f[2] = `false;
cmd_name = "FUNC_BEG";
valid_token = `false;
token_number = 0;
$lmv_tokenize(inline, 1, 1024, token_2, status_f[2]);
wk_cmd[infunction_name1:infunction_name2] = token_2;
valid_f[2] = `true;
for (i=2; i <= 2; i = i + 1) begin
if (!(valid_f[i] && status_f[i])) begin
valid_token = `false;
token_number = i;
disable block_get;
end // if
end // loop
valid_token = `true;
wk_cmd[incode1:incode2] = `func_beg_cmd;
end
endtask // get_func_beg_cmd
task get_func_end_cmd;
input [1:`token_size*8*10] inline;
output valid_token;
output [31:0] token_number;
input [31:0] msg_level;
reg valid_f[2:2];
reg status_f[2:2];
reg [1:8*8] cmd_name;
reg [(`token_size-1)*8:0] token_2;
integer i;
begin : block_get
valid_f[2] = `false;
status_f[2] = `false;
cmd_name = "FUNC_END";
valid_token = `false;
token_number = 0;
$lmv_tokenize(inline, 1, 1024, token_2, status_f[2]);
wk_cmd[infunction_name1:infunction_name2] = token_2;
valid_f[2] = `true;
for (i=2; i <= 2; i = i + 1) begin
if (!(valid_f[i] && status_f[i])) begin
valid_token = `false;
token_number = i;
disable block_get;
end // if
end // loop
valid_token = `true;
wk_cmd[incode1:incode2] = `func_end_cmd;
end
endtask // get_func_end_cmd
task get_sequential_cmd;
input [1:`token_size*8*10] inline;
output valid_token;
output [31:0] token_number;
input [31:0] msg_level;
reg valid_f [2:1];
reg status_f [2:1];
reg [1:10*8] cmd_name;
begin
valid_f[2] = `false;
valid_f[1] = `false;
cmd_name = "SEQUENTIAL";
token_number = 0;
valid_token = `true;
wk_cmd[incode1:incode2] = `sequential_cmd;
end
endtask // get_sequential_cmd
task get_stop_sim_cmd;
input [1:`token_size*8*10] inline;
output valid_token;
output [31:0] token_number;
input [31:0] msg_level;
reg valid_f [2:1];
reg status_f [2:1];
reg [1:8*8] cmd_name;
begin
valid_f[2] = `false;
valid_f[1] = `false;
cmd_name = "STOP_SIM";
token_number = 0;
valid_token = `true;
wk_cmd[incode1:incode2] = `stop_sim_cmd;
end
endtask // get_stop_sim_cmd
task get_wait_on_node_cmd;
input [1:`token_size*8*10] inline;
output valid_token;
output [31:0] token_number;
input [31:0] msg_level;
reg valid_f [2:4];
reg status_f [2:4];
reg [1:12*8] cmd_name;
reg [(`token_size-1)*8:0] token_2;
reg [(`token_size-1):0] token_3;
reg [(`token_size-1):0] token_4;
integer i;
begin : block_get
for (i=2; i <= 4; i = i + 1) begin
valid_f[i] = `false;
status_f[i] = `false;
end
cmd_name = "WAIT_ON_NODE";
valid_token = `false;
token_number = 0;
$lmv_tokenize(inline, 1, 1024, token_2, status_f[2]);
wk_cmd[innode_name1:innode_name2] = token_2;
valid_f[2] = `true;
$lmv_tokenize(inline, 2, 1024, token_3, status_f[3]);
wk_cmd[innode_value1:innode_value2] = token_3;
valid_f[3] = `true;
$lmv_tokenize(inline, 2, 1024, token_4, status_f[4]);
wk_cmd[innode_mask1:innode_mask2] = token_4;
valid_f[4] = `true;
for (i=2; i <= 4; i = i + 1) begin
if (!(valid_f[i] && status_f[i])) begin
valid_token = `false;
token_number = i;
disable block_get;
end // if
end // loop
valid_token = `true;
wk_cmd[incode1:incode2] = `wait_on_node_cmd;
end
endtask // get_wait_on_node_cmd
task get_open_buffer_cmd;
input [1:`token_size*8*10] inline;
output valid_token;
output [31:0] token_number;
input [31:0] msg_level;
reg valid_f[2:2];
reg status_f[2:2];
reg [1:11*8] cmd_name;
reg [(`token_size-1)*8:0] token_2;
integer i;
begin : block_get
valid_f[2] = `false;
status_f[2] = `false;
cmd_name = "OPEN_BUFFER";
valid_token = `false;
token_number = 0;
$lmv_tokenize(inline, 1, 1024, token_2, status_f[2]);
wk_cmd[infunction_name1:infunction_name2] = token_2;
valid_f[2] = `true;
for (i=2; i <= 2; i = i + 1) begin
if (!(valid_f[i] && status_f[i])) begin
valid_token = `false;
token_number = i;
disable block_get;
end // if
end // loop
valid_token = `true;
wk_cmd[incode1:incode2] = `open_buffer_cmd;
end
endtask // get_open_buffer_cmd
task get_close_buffer_cmd;
input [1:`token_size*8*10] inline;
output valid_token;
output [31:0] token_number;
input [31:0] msg_level;
reg valid_f[2:2];
reg status_f[2:2];
reg [1:12*8] cmd_name;
reg [(`token_size-1)*8:0] token_2;
integer i;
begin : block_get
valid_f[2] = `false;
status_f[2] = `false;
cmd_name = "CLOSE_BUFFER";
valid_token = `false;
token_number = 0;
$lmv_tokenize(inline, 1, 1024, token_2, status_f[2]);
wk_cmd[infunction_name1:infunction_name2] = token_2;
valid_f[2] = `true;
for (i=2; i <= 2; i = i + 1) begin
if (!(valid_f[i] && status_f[i])) begin
valid_token = `false;
token_number = i;
disable block_get;
end // if
end // loop
valid_token = `true;
wk_cmd[incode1:incode2] = `close_buffer_cmd;
end
endtask // get_close_buffer_cmd
task get_set_cmd;
input [1:`token_size*8*10] inline;
output valid_token;
output [31:0] token_number;
input [31:0] msg_level;
reg valid_f [2:5];
reg status_f [2:5];
reg [1:3*8] cmd_name;
reg [`token_size-1:0] token_2;
reg [`token_size-1:0] token_3;
reg [`token_size-1:0] token_4;
reg [`token_size-1:0] token_5;
integer i;
begin : block_get
for (i=2; i <= 5; i = i + 1) begin
valid_f[i] = `false;
status_f[i] = `false;
end // loop
cmd_name = "SET";
valid_token = `false;
token_number = 0;
$lmv_tokenize(inline, 1, 0, token_2, status_f[2]);
pcl_to_set_types(wk_cmd[instype1:instype2],token_2,valid_f[2],msg_level,cmd_name);
if ((valid_f[2] && status_f[2])) begin
case (wk_cmd[instype1:instype2])
mpin, mbus : begin
$lmv_tokenize(inline, 1, 0, token_3, status_f[3]);
pcl_to_object_name_types(wk_cmd[inobject_name1:inobject_name2],token_3,valid_f[3],msg_level,cmd_name);
$lmv_tokenize(inline, 2, 128, token_4, status_f[4]);
wk_cmd[inobject_value1:inobject_value2] = token_4;
valid_f[4] = `true;
$lmv_tokenize(inline, 0, 128, token_5, status_f[5]);
wk_cmd[indelay_val1:indelay_val2] = token_5 * `time_scale_multiplier;
valid_f[5] = `true;
end
mregister : begin
$lmv_tokenize(inline, 1, 0, token_3, status_f[3]);
pcl_to_object_name_types(wk_cmd[inobject_name1:inobject_name2],token_3,valid_f[3],msg_level,cmd_name);
$lmv_tokenize(inline, 2, 128, token_4, status_f[4]);
wk_cmd[inobject_value1:inobject_value2] = token_4;
valid_f[4] = `true;
valid_f[5] = `true;
status_f[5] = `true;
end
endcase
end // if
for (i=2; i <= 5; i = i + 1) begin
if (!(valid_f[i] && status_f[i])) begin
valid_token = `false;
token_number = i;
disable block_get;
end // if
end // loop
valid_token = `true;
wk_cmd[incode1:incode2] = `set_cmd;
end
endtask // get_set_cmd
task get_get_cmd;
input [1:`token_size*8*10] inline;
output valid_token;
output [31:0] token_number;
input [31:0] msg_level;
reg valid_f [2:4];
reg status_f [2:4];
reg [1:3*8] cmd_name;
reg [`token_size-1:0] token_2;
reg [`token_size-1:0] token_3;
reg [`token_size-1:0] token_4;
integer i;
begin : block_get
for (i=2; i <= 4; i = i + 1) begin
valid_f[i] = `false;
status_f[i] = `false;
end // loop
cmd_name = "GET";
valid_token = `false;
token_number = 0;
$lmv_tokenize(inline, 1, 0, token_2, status_f[2]);
pcl_to_set_types(wk_cmd[instype1:instype2],token_2,valid_f[2],msg_level,cmd_name);
$lmv_tokenize(inline, 1, 0, token_3, status_f[3]);
pcl_to_object_name_types(wk_cmd[inobject_name1:inobject_name2],token_3,valid_f[3],msg_level,cmd_name);
$lmv_tokenize(inline, 2, 128, token_4, status_f[4]);
wk_cmd[inexpected_data1:inexpected_data2] = token_4;
valid_f[4] = `true;
for (i=2; i <= 4; i = i + 1) begin
if (!(valid_f[i] && status_f[i])) begin
valid_token = `false;
token_number = i;
disable block_get;
end // if
end // loop
valid_token = `true;
wk_cmd[incode1:incode2] = `get_cmd;
end
endtask // get_get_cmd
task get_remote_cmd;
input [1:`token_size*8*10] inline;
output valid_token;
output [31:0] token_number;
input [31:0] msg_level;
reg valid_f [2:6];
reg status_f [2:6];
reg [1:6*8] cmd_name;
reg [`token_size-1:0] token_2;
reg [(`token_size-1)*8:0] token_3;
reg [`token_size-1:0] token_4;
reg [`token_size-1:0] token_5;
reg [`token_size-1:0] token_6;
integer i;
begin : block_get
for (i=2; i <= 6; i = i + 1) begin
valid_f[i] = `false;
status_f[i] = `false;
end // loop
cmd_name = "REMOTE";
valid_token = `false;
token_number = 0;
$lmv_tokenize(inline, 0, 0, token_2, status_f[2]);
wk_cmd[intarget_id1:intarget_id2] = token_2;
valid_f[2] = `true;
$lmv_tokenize(inline, 4, 1024, token_3, status_f[3]);
wk_cmd[inmsg1:inmsg2] = token_3;
valid_f[3] = `true;
$lmv_tokenize(inline, 1, 1, token_4, status_f[4]);
pcl_to_boolean(wk_cmd[inbuffer_f],token_4,valid_f[4],msg_level,cmd_name);
$lmv_tokenize(inline, 1, 1, token_5, status_f[5]);
pcl_to_boolean(wk_cmd[innotify_f],token_5,valid_f[5],msg_level,cmd_name);
$lmv_tokenize(inline, 1, 1, token_6, status_f[6]);
pcl_to_boolean(wk_cmd[inreturn_data_f],token_6,valid_f[6],msg_level,cmd_name);
for (i=2; i <= 6; i = i + 1) begin
if (!(valid_f[i] && status_f[i])) begin
valid_token = `false;
token_number = i;
disable block_get;
end // if
end // loop
valid_token = `true;
wk_cmd[incode1:incode2] = `remote_cmd;
end
endtask // get_remote_cmd
task decode_cmd;
input [1:`token_size*8] cmd;
input [1:`token_size*8*10] inline;
output status;
output [31:0] para_number;
input [31:0] msg_level;
reg valid_token;
integer token_number;
begin
case (cmd)
"read_cycle" : get_read_cycle_cmd(inline, valid_token, token_number, msg_level);
"read_intr_ack" : get_read_intr_ack_cmd(inline, valid_token, token_number, msg_level);
"read_continue" : get_read_continue_cmd(inline, valid_token, token_number, msg_level);
"write_cycle" : get_write_cycle_cmd(inline, valid_token, token_number, msg_level);
"write_special_cyc" : get_write_special_cyc_cmd(inline, valid_token, token_number, msg_level);
"write_continue" : get_write_continue_cmd(inline, valid_token, token_number, msg_level);
"configure" : get_configure_cmd(inline, valid_token, token_number, msg_level);
"idle" : get_idle_cmd(inline, valid_token, token_number, msg_level);
"sleep" : get_sleep_cmd(inline, valid_token, token_number, msg_level);
"wakeup" : get_wakeup_cmd(inline, valid_token, token_number, msg_level);
"trigger" : get_trigger_cmd(inline, valid_token, token_number, msg_level);
"wait_on" : get_wait_on_cmd(inline, valid_token, token_number, msg_level);
"print_msg" : get_print_msg_cmd(inline, valid_token, token_number, msg_level);
"set_msg_level" : get_set_msg_level_cmd(inline, valid_token, token_number, msg_level);
"call" : get_call_cmd(inline, valid_token, token_number, msg_level);
"func_beg" : get_func_beg_cmd(inline, valid_token, token_number, msg_level);
"func_end" : get_func_end_cmd(inline, valid_token, token_number, msg_level);
"sequential" : get_sequential_cmd(inline, valid_token, token_number, msg_level);
"stop_sim" : get_stop_sim_cmd(inline, valid_token, token_number, msg_level);
"wait_on_node" : get_wait_on_node_cmd(inline, valid_token, token_number, msg_level);
"open_buffer" : get_open_buffer_cmd(inline, valid_token, token_number, msg_level);
"close_buffer" : get_close_buffer_cmd(inline, valid_token, token_number, msg_level);
"set" : get_set_cmd(inline, valid_token, token_number, msg_level);
"get" : get_get_cmd(inline, valid_token, token_number, msg_level);
"remote" : get_remote_cmd(inline, valid_token, token_number, msg_level);
default : begin
if ((!(msg_level < `warnings))) begin
$display("WARNING at %0t from %m", $time);
$write(" \"Syntax Error: %0s is invalid for this model", cmd);
$display("\"");
end // if
end
endcase
status = valid_token;
para_number = token_number;
end
endtask // decode_cmd
task to_fm_data_in;
input [1:`token_size*10*8] inline;
input [31:0] msg_level; // default = warnings
integer type;
integer size;
reg [(`token_size-1)*8:0] token_1;
reg [1:`token_size*10*8] tmp_inline;
reg status [1:1];
reg cmd_status;
integer para_number;
begin : block_1
type = 3; // command
size = 0; // default
tmp_inline = inline;
status[1] = `false;
cmd_status = `false;
para_number = 0;
token_1 = "";
//get the "command" name
$lmv_tokenize(inline, type, size, token_1, status[1]);
if (!status[1]) begin
$display("WARNING at %0t from %m", $time);
$display("Syntax Error: Command \" %0s \" is invalid for this model", tmp_inline);
$display("Command Ignored");
wk_cmd[incode1:incode2] = `null_cmd;
disable block_1;
end // if
//decode "token_1"
decode_cmd(token_1, inline, cmd_status, para_number, msg_level);
if (!cmd_status) begin
$display("WARNING at %0t from %m", $time);
$display("Syntax Error: Parameter No. %0d is invalid for this command", (para_number-1));
$display(" Command \" %0s \" Ignored", tmp_inline);
wk_cmd[incode1:incode2] = `null_cmd;
disable block_1;
end // if
end
endtask // to_fm_data_in
task configure;
input [31:0] ctype;
input [64:1] generic_value;
begin
wk_cmd[inctype1:inctype2] = ctype;
case (ctype)
dev_id, ven_id, rev_id, cls_code, c_line_size, dual_ad : wk_cmd[invalue_vector1:invalue_vector2] = generic_value;
cdelay, pci_error, step, cl, rl, tl : wk_cmd[invalue_int1:invalue_int2] = generic_value;
same, back, x_trans ,type1_access: wk_cmd[invalue_bol] = generic_value;
mode : wk_cmd[inmode1:inmode2] = generic_value;
max_clk_p : wk_cmd[invalue_time1:invalue_time2] = generic_value * `time_scale_multiplier;
endcase
wk_cmd[incode1:incode2] = `configure_cmd;
wk_cmd[instrobe] = ~wk_cmd[instrobe];
end
endtask // configure
task read_intr_ack;
input [31 : 0] rtype; // enum type read_types
input [`slv_size-1 : 0] byten;
input [`slv_size-1 : 0] expected_data;
input [31 : 0] delay;
begin
wk_cmd[inrtype1:inrtype2] = rtype;
wk_cmd[inbyten1:inbyten2] = byten;
wk_cmd[inexpected_data1:inexpected_data2] = expected_data;
wk_cmd[indelay1:indelay2] = delay;
wk_cmd[incode1:incode2] = `read_cycle_cmd;
wk_cmd[instrobe] = ~wk_cmd[instrobe];
end
endtask // read_intr_ack
task read_cycle;
input [31 : 0] rtype; // enum type read_types
input [31 : 0] addr;
input [31 : 0] tc;
input [`slv_size-1 : 0] byten;
input [`slv_size-1 : 0] expected_data;
input [31 : 0] delay;
input lock;
begin
wk_cmd[inrtype1:inrtype2] = rtype;
wk_cmd[inaddr1:inaddr2] = addr;
wk_cmd[intc1:intc2] = tc;
wk_cmd[inbyten1:inbyten2] = byten;
wk_cmd[inexpected_data1:inexpected_data2] = expected_data;
wk_cmd[indelay1:indelay2] = delay;
wk_cmd[inlock1:inlock2] = lock;
wk_cmd[incode1:incode2] = `read_cycle_cmd;
wk_cmd[instrobe] = ~wk_cmd[instrobe];
end
endtask // read_cycle
task read_continue;
input [`slv_size-1 : 0] byten;
input [`slv_size-1 : 0] expected_data;
input [31 : 0] delay;
begin
wk_cmd[inbyten1:inbyten2] = byten;
wk_cmd[inexpected_data1:inexpected_data2] = expected_data;
wk_cmd[indelay1:indelay2] = delay;
wk_cmd[incode1:incode2] = `read_continue_cmd;
wk_cmd[instrobe] = ~wk_cmd[instrobe];
end
endtask // read_continue
task write_cycle;
input [31 : 0] wtype; // enum type write_types
input [31 : 0] addr;
input [31 : 0] tc;
input [`slv_size-1 : 0] byten;
input [`slv_size-1 : 0] data;
input [31 : 0] delay;
input lock;
begin
wk_cmd[inwtype1:inwtype2] = wtype;
wk_cmd[inaddr1:inaddr2] = addr;
wk_cmd[intc1:intc2] = tc;
wk_cmd[inbyten1:inbyten2] = byten;
wk_cmd[indata1:indata2] = data;
wk_cmd[indelay1:indelay2] = delay;
wk_cmd[inlock1:inlock2] = lock;
wk_cmd[incode1:incode2] = `write_cycle_cmd;
wk_cmd[instrobe] = ~wk_cmd[instrobe];
end
endtask // write_cycle
task write_special_cyc;
input [31 : 0] wtype; // enum type write_types
input [`slv_size-1 : 0] byten;
input [`slv_size-1 : 0] data;
input [31 : 0] delay;
input lock;
begin
wk_cmd[inwtype1:inwtype2] = wtype;
wk_cmd[inbyten1:inbyten2] = byten;
wk_cmd[indata1:indata2] = data;
wk_cmd[indelay1:indelay2] = delay;
wk_cmd[inlock1:inlock2] = lock;
wk_cmd[incode1:incode2] = `write_cycle_cmd;
wk_cmd[instrobe] = ~wk_cmd[instrobe];
end
endtask // write_cycle
task write_continue;
input [`slv_size-1 : 0] byten;
input [`slv_size-1 : 0] data;
input [31 : 0] delay;
begin
wk_cmd[inbyten1:inbyten2] = byten;
wk_cmd[indata1:indata2] = data;
wk_cmd[indelay1:indelay2] = delay;
wk_cmd[incode1:incode2] = `write_continue_cmd;
wk_cmd[instrobe] = ~wk_cmd[instrobe];
end
endtask // write_continue
task idle;
input [31:0] cycles;
begin
wk_cmd[incycles1:incycles2] = cycles;
wk_cmd[incode1:incode2] = `idle_cmd;
wk_cmd[instrobe] = ~wk_cmd[instrobe];
end
endtask // idle
task sleep;
input [31:0] wait_num;
begin
wk_cmd[inwait_num1:inwait_num2] = wait_num;
wk_cmd[incode1:incode2] = `sleep_cmd;
wk_cmd[instrobe] = ~wk_cmd[instrobe];
end
endtask // sleep
task wakeup;
input [31:0] wakeup_num;
begin
wk_cmd[inwakeup_num1:inwakeup_num2] = wakeup_num;
wk_cmd[incode1:incode2] = `wakeup_cmd;
wk_cmd[instrobe] = ~wk_cmd[instrobe];
end
endtask // wakeup
task trigger;
input [31:0] tvalue;
begin
wk_cmd[intvalue1:intvalue2] = tvalue;
wk_cmd[incode1:incode2] = `trigger_cmd;
wk_cmd[instrobe] = ~wk_cmd[instrobe];
end
endtask // trigger
task wait_on;
input [31:0] tvalue;
begin
wk_cmd[intvalue1:intvalue2] = tvalue;
wk_cmd[incode1:incode2] = `wait_on_cmd;
wk_cmd[instrobe] = ~wk_cmd[instrobe];
end
endtask // wait_on
task print_msg;
input [1:`token_size*8] message;
begin
wk_cmd[inmessage1:inmessage2] = "";
wk_cmd[inmessage1:inmessage2] = message;
wk_cmd[incode1:incode2] = `print_msg_cmd;
wk_cmd[instrobe] = ~wk_cmd[instrobe];
end
endtask // print_msg
task set_msg_level;
input [31:0] mlevel;
begin
wk_cmd[inmlevel1:inmlevel2] = mlevel;
wk_cmd[incode1:incode2] = `set_msg_level_cmd;
wk_cmd[instrobe] = ~wk_cmd[instrobe];
end
endtask // set_msg_level
task call;
input [1:`token_size*8] function_name;
begin
wk_cmd[infunction_name1:infunction_name2] = "";
wk_cmd[infunction_name1:infunction_name2] = function_name;
wk_cmd[incode1:incode2] = `call_cmd;
wk_cmd[instrobe] = ~wk_cmd[instrobe];
end
endtask // call
task func_beg;
input [1:`token_size*8] function_name;
begin
wk_cmd[infunction_name1:infunction_name2] = "";
wk_cmd[infunction_name1:infunction_name2] = function_name;
wk_cmd[incode1:incode2] = `func_beg_cmd;
wk_cmd[instrobe] = ~wk_cmd[instrobe];
end
endtask // func_beg
task func_end;
input [1:`token_size*8] function_name;
begin
wk_cmd[infunction_name1:infunction_name2] = "";
wk_cmd[infunction_name1:infunction_name2] = function_name;
wk_cmd[incode1:incode2] = `func_end_cmd;
wk_cmd[instrobe] = ~wk_cmd[instrobe];
end
endtask // func_end
task sequential;
begin
wk_cmd[incode1:incode2] = `sequential_cmd;
wk_cmd[instrobe] = ~wk_cmd[instrobe];
end
endtask // sequential
task stop_sim;
begin
wk_cmd[incode1:incode2] = `stop_sim_cmd;
wk_cmd[instrobe] = ~wk_cmd[instrobe];
end
endtask // stop_sim
task wait_on_node;
input [1:`token_size*8] node_name;
input [1:`token_size] node_value;
input [1:`token_size] node_mask;
begin
wk_cmd[innode_name1:innode_name2] = node_name;
wk_cmd[innode_value1:innode_value2] = node_value;
wk_cmd[innode_mask1:innode_mask2] = node_mask;
wk_cmd[incode1:incode2] = `wait_on_node_cmd;
wk_cmd[instrobe] = ~wk_cmd[instrobe];
end
endtask // wait_on_node
task open_buffer;
input [1:`token_size*8] function_name;
begin
wk_cmd[infunction_name1:infunction_name2] = "";
wk_cmd[infunction_name1:infunction_name2] = function_name;
wk_cmd[incode1:incode2] = `open_buffer_cmd;
wk_cmd[instrobe] = ~wk_cmd[instrobe];
end
endtask // open_buffer
task close_buffer;
input [1:`token_size*8] function_name;
begin
wk_cmd[infunction_name1:infunction_name2] = "";
wk_cmd[infunction_name1:infunction_name2] = function_name;
wk_cmd[incode1:incode2] = `close_buffer_cmd;
wk_cmd[instrobe] = ~wk_cmd[instrobe];
end
endtask // close_buffer
task set;
input [31:0] stype;
input [31:0] object_name;
input [`slv_size-1:0] object_value;
input [31:0] delay_val;
begin
wk_cmd[instype1:instype2] = stype;
wk_cmd[inobject_name1:inobject_name2] = object_name;
wk_cmd[inobject_value1:inobject_value2] = 64'hxxxxxxxxxxxxxxxx; // (others => '-')
wk_cmd[inobject_value1:inobject_value2] = object_value;
wk_cmd[indelay_val1:indelay_val2] = delay_val * `time_scale_multiplier;
wk_cmd[incode1:incode2] = `set_cmd;
wk_cmd[instrobe] = ~wk_cmd[instrobe];
end
endtask // set
task get;
input [31:0] stype;
input [31:0] object_name;
input [`slv_size-1:0] expected_data;
begin
wk_cmd[instype1:instype2] = stype;
wk_cmd[inobject_name1:inobject_name2] = object_name;
wk_cmd[inexpected_data1:inexpected_data2] = 64'hxxxxxxxxxxxxxxxx;
wk_cmd[inexpected_data1:inexpected_data2] = expected_data;
wk_cmd[incode1:incode2] = `get_cmd;
wk_cmd[instrobe] = ~wk_cmd[instrobe];
end
endtask // get
task remote;
input [31:0] target_id;
input [1:`token_size*8] msg;
input buffer_f;
input notify_f;
input return_data_f;
begin
wk_cmd[intarget_id1:intarget_id2] = target_id;
wk_cmd[inmsg1:inmsg2] = "";
wk_cmd[inmsg1:inmsg2] = msg;
wk_cmd[inbuffer_f] = buffer_f;
wk_cmd[innotify_f] = notify_f;
wk_cmd[inreturn_data_f] = return_data_f;
wk_cmd[incode1:incode2] = `remote_cmd;
wk_cmd[instrobe] = ~wk_cmd[instrobe];
end
endtask // remote
//--**--**--**--**--**--**--**--**-- USER CODE END
function [31:0] calc_curve;
input [31:0] x, c2, c1, c0;
begin
calc_curve = c2*(lmcver.power(x,2))/100 + c1*x + c0;
end
endfunction
task get_timing;
inout [31:0] local_times_trs_pad_pclk;
inout [31:0] local_times_trh_pad_pclk;
inout [31:0] local_times_twd_pad_31;
inout [31:0] local_times_twd_pad_30;
inout [31:0] local_times_twd_pad_29;
inout [31:0] local_times_twd_pad_28;
inout [31:0] local_times_twd_pad_27;
inout [31:0] local_times_twd_pad_26;
inout [31:0] local_times_twd_pad_25;
inout [31:0] local_times_twd_pad_24;
inout [31:0] local_times_twd_pad_23;
inout [31:0] local_times_twd_pad_22;
inout [31:0] local_times_twd_pad_21;
inout [31:0] local_times_twd_pad_20;
inout [31:0] local_times_twd_pad_19;
inout [31:0] local_times_twd_pad_18;
inout [31:0] local_times_twd_pad_17;
inout [31:0] local_times_twd_pad_16;
inout [31:0] local_times_twd_pad_15;
inout [31:0] local_times_twd_pad_14;
inout [31:0] local_times_twd_pad_13;
inout [31:0] local_times_twd_pad_12;
inout [31:0] local_times_twd_pad_11;
inout [31:0] local_times_twd_pad_10;
inout [31:0] local_times_twd_pad_9;
inout [31:0] local_times_twd_pad_8;
inout [31:0] local_times_twd_pad_7;
inout [31:0] local_times_twd_pad_6;
inout [31:0] local_times_twd_pad_5;
inout [31:0] local_times_twd_pad_4;
inout [31:0] local_times_twd_pad_3;
inout [31:0] local_times_twd_pad_2;
inout [31:0] local_times_twd_pad_1;
inout [31:0] local_times_twd_pad_0;
inout [31:0] local_times_tpr_pclk_pad_0;
inout [31:0] local_times_tpr_pclk_pad_1;
inout [31:0] local_times_tpr_pclk_pad_x;
inout [31:0] local_times_tpr_pclk_pad_z;
inout [31:0] local_times_thrx_pclk_pad;
inout [31:0] local_times_tld_pad_31;
inout [31:0] local_times_tld_pad_30;
inout [31:0] local_times_tld_pad_29;
inout [31:0] local_times_tld_pad_28;
inout [31:0] local_times_tld_pad_27;
inout [31:0] local_times_tld_pad_26;
inout [31:0] local_times_tld_pad_25;
inout [31:0] local_times_tld_pad_24;
inout [31:0] local_times_tld_pad_23;
inout [31:0] local_times_tld_pad_22;
inout [31:0] local_times_tld_pad_21;
inout [31:0] local_times_tld_pad_20;
This page: |
Created: | Thu Aug 19 12:03:06 1999 |
| From: |
../../../sparc_v8/system/lmc/rtl/pcimaster_timing.v
|