ev[ 34] = pad[0]; // Bi-directional Bus
ev[ 35] = pcxbenn[3]; // Input Bus
ev[ 36] = pcxbenn[2]; // Input Bus
ev[ 37] = pcxbenn[1]; // Input Bus
ev[ 38] = pcxbenn[0]; // Input Bus
ev[ 39] = ppar_d; // The direction of Bi-directional Pin
ev[ 40] = ppar; // A Bi-directional Pin
ev[ 41] = pframenn; // An Input Pin
ev[ 42] = ptrdynn_d; // The direction of Bi-directional Pin
ev[ 43] = ptrdynn; // A Bi-directional Pin
ev[ 44] = pirdynn; // An Input Pin
ev[ 45] = pstopnn_d; // The direction of Bi-directional Pin
ev[ 46] = pstopnn; // A Bi-directional Pin
ev[ 47] = pdevselnn; // An Output Pin
ev[ 48] = pidsel; // An Input Pin
ev[ 49] = psbonn; // An Input Pin
ev[ 50] = psdone; // An Input Pin
ev[ 51] = pclk; // An Input Pin
ev[ 52] = prstnn; // An Input Pin
ev[ 53] = pd_d; // The direction of Bi-directional Bus
ev[ 54] = pd[63]; // Bi-directional Bus
ev[ 55] = pd[62]; // Bi-directional Bus
ev[ 56] = pd[61]; // Bi-directional Bus
ev[ 57] = pd[60]; // Bi-directional Bus
ev[ 58] = pd[59]; // Bi-directional Bus
ev[ 59] = pd[58]; // Bi-directional Bus
ev[ 60] = pd[57]; // Bi-directional Bus
ev[ 61] = pd[56]; // Bi-directional Bus
ev[ 62] = pd[55]; // Bi-directional Bus
ev[ 63] = pd[54]; // Bi-directional Bus
ev[ 64] = pd[53]; // Bi-directional Bus
ev[ 65] = pd[52]; // Bi-directional Bus
ev[ 66] = pd[51]; // Bi-directional Bus
ev[ 67] = pd[50]; // Bi-directional Bus
ev[ 68] = pd[49]; // Bi-directional Bus
ev[ 69] = pd[48]; // Bi-directional Bus
ev[ 70] = pd[47]; // Bi-directional Bus
ev[ 71] = pd[46]; // Bi-directional Bus
ev[ 72] = pd[45]; // Bi-directional Bus
ev[ 73] = pd[44]; // Bi-directional Bus
ev[ 74] = pd[43]; // Bi-directional Bus
ev[ 75] = pd[42]; // Bi-directional Bus
ev[ 76] = pd[41]; // Bi-directional Bus
ev[ 77] = pd[40]; // Bi-directional Bus
ev[ 78] = pd[39]; // Bi-directional Bus
ev[ 79] = pd[38]; // Bi-directional Bus
ev[ 80] = pd[37]; // Bi-directional Bus
ev[ 81] = pd[36]; // Bi-directional Bus
ev[ 82] = pd[35]; // Bi-directional Bus
ev[ 83] = pd[34]; // Bi-directional Bus
ev[ 84] = pd[33]; // Bi-directional Bus
ev[ 85] = pd[32]; // Bi-directional Bus
ev[ 86] = pbenn[7]; // Input Bus
ev[ 87] = pbenn[6]; // Input Bus
ev[ 88] = pbenn[5]; // Input Bus
ev[ 89] = pbenn[4]; // Input Bus
ev[ 90] = ppar64_d; // The direction of Bi-directional Pin
ev[ 91] = ppar64; // A Bi-directional Pin
ev[ 92] = preq64nn; // An Input Pin
ev[ 93] = pack64nn; // An Output Pin
ev[ 94] = plocknn; // An Input Pin
ev[ 95] = pperrnn; // An Output Pin
ev[ 96] = pserrnn; // An Output Pin
$fdisplay(fpat, "%d : %b", dtime, ev[2 : 96]);
end
endtask //generate_pattern;
always begin : gen_pattern
if (msg_level === `debug_1) begin
if (pat_gen_init) begin
$timeformat(-10, 0, "00", 10);
fpat = $fopen(pat_file);
gen_pat_print_header;
pat_gen_init = `false;
end
generate_pattern;
@(pad or pcxbenn or ppar or pframenn or ptrdynn or pirdynn or pstopnn or pdevselnn or pidsel or psbonn or psdone or pclk or prstnn or pd or pbenn or ppar64 or preq64nn or pack64nn or plocknn or pperrnn or pserrnn or msg_level);
end else
@(msg_level);
end // pat_generator
//====================================--
// END PATTERN GENERATOR SECTION --
//====================================--
//----- FM MAIN PROCESS -----
//--------------------------------------------
//-- Declarations Used By Multiple Sections --
//--------------------------------------------
parameter fm_data_in1 = 1;
parameter fm_data_in2 = 6118;
reg [fm_data_in1:fm_data_in2] fm_cmd
; // IN fm_data_in
parameter incode1 = 1;
parameter incode2 = 32;
parameter instrobe = 33;
parameter inctype1 = 34;
parameter inctype2 = 65;
parameter invalue_vector1 = 66;
parameter invalue_vector2 = 129;
parameter invalue_boolean = 130;
parameter invalue1 = 131;
parameter invalue2 = 162;
parameter indelay_index1 = 163;
parameter indelay_index2 = 194;
parameter indelay1 = 195;
parameter indelay2 = 226;
parameter inrequest_limit1 = 227;
parameter inrequest_limit2 = 258;
parameter indecode1 = 259;
parameter indecode2 = 290;
parameter incycles1 = 291;
parameter incycles2 = 322;
parameter intvalue1 = 323;
parameter intvalue2 = 354;
parameter inmessage1 = 355;
parameter inmessage2 = 1378;
parameter inmlevel1 = 1379;
parameter inmlevel2 = 1410;
parameter infunction_name1 = 1411;
parameter infunction_name2 = 2434;
parameter instype1 = 2435;
parameter instype2 = 2466;
parameter inobject_name1 = 2467;
parameter inobject_name2 = 2498;
parameter inobject_value1 = 2499;
parameter inobject_value2 = 2562;
parameter indelay_val1 = 2563;
parameter indelay_val2 = 2594;
parameter inmtype1 = 2595;
parameter inmtype2 = 2626;
parameter insaddr1 = 2627;
parameter insaddr2 = 2690;
parameter inexpected_data1 = 2691;
parameter inexpected_data2 = 2754;
parameter indfile1 = 2755;
parameter indfile2 = 3778;
parameter inflush_f = 3779;
parameter instart_addr1 = 3780;
parameter instart_addr2 = 3843;
parameter inend_addr1 = 3844;
parameter inend_addr2 = 3907;
parameter intarget_id1 = 3908;
parameter intarget_id2 = 3939;
parameter inmsg1 = 3940;
parameter inmsg2 = 4963;
parameter inbuffer_f = 4964;
parameter innotify_f = 4965;
parameter inreturn_data_f = 4966;
parameter innode_name1 = 4967;
parameter innode_name2 = 5990;
parameter innode_value1 = 5991;
parameter innode_value2 = 6054;
parameter innode_mask1 = 6055;
parameter innode_mask2 = 6118;
parameter cbfield1 = 1;
parameter cbfield2 = 2182;
parameter cbinitiator_id1 = 1;
parameter cbinitiator_id2 = 32;
parameter cbtarget_id1 = 33;
parameter cbtarget_id2 = 64;
parameter cbtransaction1 = 65;
parameter cbtransaction2 = 96;
parameter cbbuffer_f = 97;
parameter cbnotify_f = 98;
parameter cbreturn_data_f = 99;
parameter cbdone_f = 100;
parameter cbdvalid_f = 101;
parameter cbbuffer_avail_f = 102;
parameter cbmsg1 = 103;
parameter cbmsg2 = 2150;
parameter cbtag1 = 2151;
parameter cbtag2 = 2182;
parameter fmcode1 = 2183;
parameter fmcode2 = 2214;
parameter fmstrobe = 2215;
parameter fmctype1 = 2216;
parameter fmctype2 = 2247;
parameter fmvalue_vector1 = 2248;
parameter fmvalue_vector2 = 2311;
parameter fmvalue_boolean = 2312;
parameter fmvalue1 = 2313;
parameter fmvalue2 = 2344;
parameter fmdelay_index1 = 2345;
parameter fmdelay_index2 = 2376;
parameter fmdelay1 = 2377;
parameter fmdelay2 = 2408;
parameter fmrequest_limit1 = 2409;
parameter fmrequest_limit2 = 2440;
parameter fmdecode1 = 2441;
parameter fmdecode2 = 2472;
parameter fmcycles1 = 2473;
parameter fmcycles2 = 2504;
parameter fmtvalue1 = 2505;
parameter fmtvalue2 = 2536;
parameter fmmessage1 = 2537;
parameter fmmessage2 = 3560;
parameter fmmlevel1 = 3561;
parameter fmmlevel2 = 3592;
parameter fmfunction_name1 = 3593;
parameter fmfunction_name2 = 4616;
parameter fmstype1 = 4617;
parameter fmstype2 = 4648;
parameter fmobject_name1 = 4649;
parameter fmobject_name2 = 4680;
parameter fmobject_value1 = 4681;
parameter fmobject_value2 = 4744;
parameter fmdelay_val1 = 4745;
parameter fmdelay_val2 = 4776;
parameter fmmtype1 = 4777;
parameter fmmtype2 = 4808;
parameter fmsaddr1 = 4809;
parameter fmsaddr2 = 4872;
parameter fmexpected_data1 = 4873;
parameter fmexpected_data2 = 4936;
parameter fmdfile1 = 4937;
parameter fmdfile2 = 5960;
parameter fmflush_f = 5961;
parameter fmstart_addr1 = 5962;
parameter fmstart_addr2 = 6025;
parameter fmend_addr1 = 6026;
parameter fmend_addr2 = 6089;
parameter fmtarget_id1 = 6090;
parameter fmtarget_id2 = 6121;
parameter fmmsg1 = 6122;
parameter fmmsg2 = 7145;
parameter fmbuffer_f = 7146;
parameter fmnotify_f = 7147;
parameter fmreturn_data_f = 7148;
parameter fmnode_name1 = 7149;
parameter fmnode_name2 = 8172;
parameter fmnode_value1 = 8173;
parameter fmnode_value2 = 8236;
parameter fmnode_mask1 = 8237;
parameter fmnode_mask2 = 8300;
parameter fmfield1 = 2183;
parameter fmfield2 = 8300;
parameter ctrl_store1 = 1;
parameter ctrl_store2 = 8300;
parameter ackinitiator_id1 = 1;
parameter ackinitiator_id2 = 32;
parameter acktarget_id1 = 33;
parameter acktarget_id2 = 64;
parameter ackack_val1 = 65;
parameter ackack_val2 = 96;
// type msg_level_types is
parameter no_msg = 0;
parameter warnings = 1;
parameter debug_1 = 2;
parameter debug_2 = 3;
parameter debug_3 = 4;
parameter debug_cb = 5;
parameter debug_int = 6;
parameter debug_cmd_mem = 7;
//type set_types is
parameter mpin = 0;
parameter mbus = 1;
parameter mregister = 2;
//type object_name_types is
parameter pad_bus = 3;
parameter pad_0 = 4;
parameter pad_1 = 5;
parameter pad_2 = 6;
parameter pad_3 = 7;
parameter pad_4 = 8;
parameter pad_5 = 9;
parameter pad_6 = 10;
parameter pad_7 = 11;
parameter pad_8 = 12;
parameter pad_9 = 13;
parameter pad_10 = 14;
parameter pad_11 = 15;
parameter pad_12 = 16;
parameter pad_13 = 17;
parameter pad_14 = 18;
parameter pad_15 = 19;
parameter pad_16 = 20;
parameter pad_17 = 21;
parameter pad_18 = 22;
parameter pad_19 = 23;
parameter pad_20 = 24;
parameter pad_21 = 25;
parameter pad_22 = 26;
parameter pad_23 = 27;
parameter pad_24 = 28;
parameter pad_25 = 29;
parameter pad_26 = 30;
parameter pad_27 = 31;
parameter pad_28 = 32;
parameter pad_29 = 33;
parameter pad_30 = 34;
parameter pad_31 = 35;
parameter pcxbenn_bus = 36;
parameter pcxbenn_0 = 37;
parameter pcxbenn_1 = 38;
parameter pcxbenn_2 = 39;
parameter pcxbenn_3 = 40;
parameter ppar_pin = 41;
parameter pframenn_pin = 42;
parameter ptrdynn_pin = 43;
parameter pirdynn_pin = 44;
parameter pstopnn_pin = 45;
parameter pdevselnn_pin = 46;
parameter pidsel_pin = 47;
parameter psbonn_pin = 48;
parameter psdone_pin = 49;
parameter pclk_pin = 50;
parameter prstnn_pin = 51;
parameter pd_bus = 52;
parameter pd_32 = 53;
parameter pd_33 = 54;
parameter pd_34 = 55;
parameter pd_35 = 56;
parameter pd_36 = 57;
parameter pd_37 = 58;
parameter pd_38 = 59;
parameter pd_39 = 60;
parameter pd_40 = 61;
parameter pd_41 = 62;
parameter pd_42 = 63;
parameter pd_43 = 64;
parameter pd_44 = 65;
parameter pd_45 = 66;
parameter pd_46 = 67;
parameter pd_47 = 68;
parameter pd_48 = 69;
parameter pd_49 = 70;
parameter pd_50 = 71;
parameter pd_51 = 72;
parameter pd_52 = 73;
parameter pd_53 = 74;
parameter pd_54 = 75;
parameter pd_55 = 76;
parameter pd_56 = 77;
parameter pd_57 = 78;
parameter pd_58 = 79;
parameter pd_59 = 80;
parameter pd_60 = 81;
parameter pd_61 = 82;
parameter pd_62 = 83;
parameter pd_63 = 84;
parameter pbenn_bus = 85;
parameter pbenn_4 = 86;
parameter pbenn_5 = 87;
parameter pbenn_6 = 88;
parameter pbenn_7 = 89;
parameter ppar64_pin = 90;
parameter preq64nn_pin = 91;
parameter pack64nn_pin = 92;
parameter plocknn_pin = 93;
parameter pperrnn_pin = 94;
parameter pserrnn_pin = 95;
//type config_types is :
parameter transfer_limit = 96;
parameter abort_limit = 97;
parameter termination_style = 98;
parameter pci_error = 99;
parameter decode = 100;
parameter delays = 101;
parameter dev_id = 102;
parameter ven_id = 103;
parameter rev_id = 104;
parameter h_type = 105;
parameter cls_code = 106;
parameter mem_l_0 = 107;
parameter mem_u_0 = 108;
parameter mem_l_1 = 109;
parameter mem_u_1 = 110;
parameter mem_l_2 = 111;
parameter mem_u_2 = 112;
parameter io_l_0 = 113;
parameter io_u_0 = 114;
parameter io_l_1 = 115;
parameter io_u_1 = 116;
parameter io_l_2 = 117;
parameter io_u_2 = 118;
parameter c_line_size = 119;
parameter addr_64 = 120;
parameter data_64 = 121;
parameter int_ack = 122;
parameter int_ack_vector = 123;
parameter type1_access = 124;
//type mem_types is
parameter mem = 124;
parameter io = 125;
parameter cfg = 126;
initial fm_cmd = timing.fm_data_in_init;
reg check_cb_ack
; initial check_cb_ack
= 1'b0;
parameter zero_delay = {32'h0, 32'h0, 32'h0, 32'h0};
integer cmd_src
; initial cmd_src
= `embedded;
integer delete_cmd_code
; initial delete_cmd_code
= `null_cmd;
//code of command to delete from ctrl_queue;
//assigned by modeler, deleted within get_nxt_cmd
integer lq_delete_cmd_code
; initial lq_delete_cmd_code
= `null_cmd;
//code of command to delete from ctrl_queue;
//assigned by controller, deleted within load_queue
reg lq_vfyn_f
; initial lq_vfyn_f
= `false;
//flag to notify load_queue that it should verify the
//next multi-cycle command queued is NOT lq_delete_cmd_code
parameter initial_max_cmd_mem_size = 400; //Change initial value to alter the size of the
//internal memory which is used to store commands
//read from the external command file
integer max_cmd_mem_size
; initial max_cmd_mem_size
= initial_max_cmd_mem_size - 5;
parameter max_ctrl_queue_size = 1000; //Change initial value to alter the size of the
//internal memory which is used to store commands
//that are queued to be executed
reg new_cmd_f
; initial new_cmd_f
= `false;
//signifies when ctrl_queue_beg holds a new command,
//get_nxt_cmd sets false when this command is next, only used by slave type devices
integer load_mem_addr
; initial load_mem_addr
= 0; //for loading from file and buffered cb commands
integer curr_mem_addr
; initial curr_mem_addr
= 0; //for loading from cmd_memory
reg [1:`token_size*8] nul_token
; initial nul_token
= "";
reg [1:`max_cmd_size*8] nul_cmd_str
; initial nul_cmd_str
= "";
reg [cbfield1:cbfield2] cb_field_local_cmd
; // control_bus_type
initial begin
cb_field_local_cmd[cbinitiator_id1:cbinitiator_id2] = id_number;
cb_field_local_cmd[cbtarget_id1:cbtarget_id2] = id_number;
cb_field_local_cmd[cbtransaction1:cbtransaction2] = `cmd_trans;
cb_field_local_cmd[cbbuffer_f] = 1'b0;
cb_field_local_cmd[cbnotify_f] = 1'b0;
cb_field_local_cmd[cbreturn_data_f] = 1'b0;
cb_field_local_cmd[cbdone_f] = 1'b0;
cb_field_local_cmd[cbdvalid_f] = 1'b0;
cb_field_local_cmd[cbbuffer_avail_f] = 1'b0;
cb_field_local_cmd[cbmsg1:cbmsg2] = nul_cmd_str;
cb_field_local_cmd[cbtag1:cbtag2] = 0;
end
//return data/expected data variables --used by return_data,done_chks
reg dvalid_f
; initial dvalid_f
= `false;
reg [`slv_size-1 : 0] ret_addr_slv
; //initial ret_addr_slv = "";
reg [`slv_size-1 : 0] ret_data_slv
; //initial ret_data_slv = "";
reg [`slv_size-1 : 0] ret_data_mask
;
reg [127:0] ret_data_ary
[0 : `ret_ary_len-1]; // ret_data_ary
reg [127:0] ret_data_ary_hold
;
integer ret_data_ptr
; initial ret_data_ptr
= 0;
integer ret_data_t
; initial ret_data_t
= 0 * `time_scale_multiplier;
reg [cbfield1:cbfield2] dspch_data
; // control_bus_type
reg dspch_data_f
; initial dspch_data_f
= `false;
reg wait_on_done_f
; initial wait_on_done_f
= `false;
reg done_f_rcvd
; initial done_f_rcvd
= `false;
integer wait_on_done_tag
; initial wait_on_done_tag
= 0;
reg issued_busy_f
; initial issued_busy_f
= `false;
reg wait_on_avail_f
; initial wait_on_avail_f
= `false;
integer wait_on_avail_id
; initial wait_on_avail_id
= 0;
reg fm_cmd_strobe_event
;
always @(fm_cmd[instrobe]) begin
fm_cmd_strobe_event = `true;
fm_cmd_strobe_event <= #(0) `false;
end
task bfm_msg;
input [1 : `token_size*8*10] message;
input [31 : 0] message_level;
input [31 : 0] msg_level;
integer sev_level;
integer note;
begin
note = 100;
sev_level = note;
if (message_level === `warnings) begin
sev_level = `warnings;
end // if
case (sev_level)
note : begin
if (msg_level >= message_level) begin
$display("NOTE at %0t from %m", $time);
$display(" \" %0s\" ", message);
end // if
end
`warnings : begin
if (msg_level >= message_level) begin
$display("WARNING at %0t from %m", $time);
$display(" \" %0s\" ", message);
end // if
end
endcase
end
endtask // bfm_msg
function [1:32*8] cmd2string;
input [31:0] cmd_code;
reg [1:32*8] tmp_str;
begin
case (cmd_code)
`remote_cmd : tmp_str = " remote_cmd ";
`restart_cmd : tmp_str = " restart_cmd ";
`rte_cmd : tmp_str = " rte_cmd ";
`trigger_cmd : tmp_str = " trigger_cmd ";
`wait_on_cmd : tmp_str = " wait_on_cmd ";
`print_msg_cmd : tmp_str = " print_msg_cmd ";
`set_msg_level_cmd : tmp_str = " set_msg_level_cmd ";
`call_cmd : tmp_str = " call_cmd ";
`open_buffer_cmd : tmp_str = " open_buffer_cmd ";
`close_buffer_cmd : tmp_str = " close_buffer_cmd ";
`func_beg_cmd : tmp_str = " func_beg_cmd ";
`func_end_cmd : tmp_str = " func_end_cmd ";
`sequential_cmd : tmp_str = " sequential_cmd ";
`stop_sim_cmd : tmp_str = " stop_sim_cmd ";
`wait_on_node_cmd : tmp_str = " wait_on_node_cmd ";
`set_cmd : tmp_str = " set_cmd ";
`get_cmd : tmp_str = " get_cmd ";
`reload_cmd : tmp_str = " reload_cmd ";
`dump_cmd : tmp_str = " dump_cmd ";
`configure_cmd : tmp_str = " configure_cmd ";
`query_cmd : tmp_str = " query_cmd ";
`idle_cmd : tmp_str = " idle_cmd ";
`read_mod_write_cmd : tmp_str = " read_modify_write_cmd ";
`read_until : tmp_str = " read_until_compare ";
`transfer_cmd : tmp_str = " transfer_cmd ";
`request_cmd : tmp_str = " request_cmd ";
`connect_cmd : tmp_str = " connect_cmd ";
`detach_cmd : tmp_str = " detach_cmd ";
`wakeup_cmd : tmp_str = " wakeup_cmd ";
`sleep_cmd : tmp_str = " sleep_cmd ";
`start_cmd : tmp_str = " start_cmd ";
`halt_cmd : tmp_str = " halt_cmd ";
`shutdown_cmd : tmp_str = " shutdown_cmd ";
`null_cmd : tmp_str = " null_cmd ";
default : tmp_str = " illegal cmd[incode1:incode2] ";
endcase
cmd2string = tmp_str;
end
endfunction // cmd2string
function [1:16*8] cbackval2string;
input [31:0] ack_val;
reg [1:16*8] tmp;
begin
case (ack_val)
`ack_rsp : tmp = "ack_rsp";
`busy_rsp : tmp = "busy_rsp";
`unknown : tmp = "unknown";
`Release : tmp = "Release";
endcase
cbackval2string = tmp;
end
endfunction // cbackval2string
function [1:16*8] trans2string;
input [31:0] trans_val;
begin
case (trans_val)
`cmd_trans : trans2string = "cmd_trans";
`status_trans : trans2string = "status_trans";
endcase
end
endfunction // trans2string
task cb2string;
input [cbfield1:cbfield2] cb;
begin
if (cb[cbtransaction1:cbtransaction2] === `cmd_trans) begin
$display(" \"initiator_id = %0d", cb[cbinitiator_id1:cbinitiator_id2]);
$display(" target_id = %0d", cb[cbtarget_id1:cbtarget_id2]);
$display(" transaction = %0s", trans2string(cb[cbtransaction1:cbtransaction2]));
$display(" buffer_f = %b", cb[cbbuffer_f]);
$display(" notify_f = %b", cb[cbnotify_f]);
$display(" return_data_f = %b", cb[cbreturn_data_f]);
$display(" msg = %0s", cb[cbmsg1:cbmsg2]);
$display(" tag = %0d\"", cb[cbtag1:cbtag2]);
end else if (cb[cbtransaction1:cbtransaction2] === `status_trans) begin
$display(" \"initiator_id = %0d", cb[cbinitiator_id1:cbinitiator_id2]);
$display(" target_id = %0d", cb[cbtarget_id1:cbtarget_id2]);
$display(" transaction = %0s", trans2string(cb[cbtransaction1:cbtransaction2]));
$display(" done_f = %b", cb[cbdone_f]);
$display(" dvalid_f = %b", cb[cbdvalid_f]);
$display(" buffer_avail_f = %b", cb[cbbuffer_avail_f]);
$display(" msg = %0s", cb[cbmsg1:cbmsg2]);
$display(" tag = %0d\"", cb[cbtag1:cbtag2]);
end // if
end
endtask // cb2string
//----------------------
// MEMORY STRUCTURES --
//----------------------
//Controller Command Queue
//dynamic fifo - allocated/deallocated with every queue/dequeue, respectively
// type which_end_type is
parameter end_of_queue = 0;
parameter beg_of_queue = 1;
integer ctrl_queue_pointer
; initial ctrl_queue_pointer
= 1;
integer ctrl_queue_size
; initial ctrl_queue_size
= 0;
reg [ctrl_store1:ctrl_store2] ctrl_queue
[1 : max_ctrl_queue_size]; // ctrl_store_data
reg [ctrl_store1:ctrl_store2] ctrl_queue_hold
; // ctrl_store_data
integer temp_cmd_ptr
;
reg [ctrl_store1:ctrl_store2] temp_cmd
; // ctrl_store_data
integer queue_size
; initial queue_size
= 0;
integer num_non_immed_queued
; initial num_non_immed_queued
= 0;
//Command Memory Structure
//exe_nxt_buf, stores remote-execute type commands, used only as one-deep queue
integer exe_nxt_buf_pointer
; initial exe_nxt_buf_pointer
= 0;
reg [ctrl_store1:ctrl_store2] exe_nxt_buf
[1 : 1]; //?? // ctrl_store_data
reg [ctrl_store1:ctrl_store2] exe_nxt_buf_hold
; // ctrl_store_data
//external file and remote-buffer commands (including P-code)
reg cmd_mem_full_f
; initial cmd_mem_full_f
= `false;
integer cmd_mem_counter
; initial cmd_mem_counter
= 0;
reg [cbfield1:cbfield2] tmp_cb
; initial tmp_cb
= cb_field_local_cmd; // control_bus_type
reg [cbfield1:cbfield2] cmd_mem
[1 : initial_max_cmd_mem_size]; // control_bus_type
reg [cbfield1:cbfield2] cmd_mem_hold
;
//==================================================================--
// TOOL-GENERATED MODEL-SPECIFIC VARIABLES --
//==================================================================--
//Command Pipelining
parameter pipeline_depth = 2; //size of executer's cmd_queue
integer cmd_queue_pointer
; initial cmd_queue_pointer
= 0;
reg [fm_data_in1:fm_data_in2] cmd_queue
[0 : pipeline_depth-1]; // fm_data_in
reg [fm_data_in1:fm_data_in2] cmd_queue_hold
;
integer i
;
initial begin
for (i = 0; i <= pipeline_depth-1; i = i + 1) cmd_queue[i] = timing.fm_data_in_init;
end
reg [fm_data_in1:fm_data_in2] curr_cmd
; // fm_data_in
initial curr_cmd = timing.fm_data_in_init; //updated by controller, used by executer,
//holds copy of cmd_queue[0]
//--==================================================================--
//-- TOOL-GENERATED MODEL-SPECIFIC SUBPROGRAMS --
//--==================================================================--
reg x_transition_l
; initial x_transition_l
= `true;
reg [31:0] pad_out_mask
; initial pad_out_mask
= 32'h0;
reg [63:32] pd_out_mask
; initial pd_out_mask
= 32'h0;
reg first_mem_dump
; initial first_mem_dump
= `true;
reg first_io_dump
; initial first_io_dump
= `true;
reg first_cfg_dump
; initial first_cfg_dump
= `true;
integer fm
;
integer fi
;
integer fc
;
integer line_size
; initial line_size
= 0;
`ifdef no_pli
parameter max_addr_width = 20;
parameter max_addr = 20'hfffff;
reg [31:0] cfg_head[2048:0];
reg [31:0] mem_head[max_addr:0];
reg [31:0] io_head[max_addr:0];
`else
`ifdef paged
parameter page_size = 512;
`endif
`endif
//----------------------------
//-- PIN OUTPUT SUBPROGRAMS --
//----------------------------
task pad_out;
input [31:0] output_vector;
input [127:0] delay_in;
input [31:0] skew_in;
integer delay[0:3];
integer delay_time, skew, i;
begin
delay[0] = delay_in[31:0];
delay[1] = delay_in[63:32];
delay[2] = delay_in[95:64];
delay[3] = delay_in[127:96];
skew = skew_in;
pad_d = 1'b0; //init to input, not driving
for (i=0; i<=31; i=i+1) begin
if (pad_out_mask[i] !== 1'b1) begin
delay_time = delay[lmcver.map(output_vector[i])] + model_times.tld_pad[i] + skew;
if (delay_time < 0) begin delay_time = 0; end
begin : pad_loop
if ((!x_transition_l) && (output_vector[i] === 1'bx)) begin disable pad_loop; end
case (i)
0: pad_reg_0 <= #( delay_time) output_vector[i];
1: pad_reg_1 <= #( delay_time) output_vector[i];
2: pad_reg_2 <= #( delay_time) output_vector[i];
3: pad_reg_3 <= #( delay_time) output_vector[i];
4: pad_reg_4 <= #( delay_time) output_vector[i];
5: pad_reg_5 <= #( delay_time) output_vector[i];
6: pad_reg_6 <= #( delay_time) output_vector[i];
7: pad_reg_7 <= #( delay_time) output_vector[i];
8: pad_reg_8 <= #( delay_time) output_vector[i];
9: pad_reg_9 <= #( delay_time) output_vector[i];
10: pad_reg_10 <= #( delay_time) output_vector[i];
11: pad_reg_11 <= #( delay_time) output_vector[i];
12: pad_reg_12 <= #( delay_time) output_vector[i];
13: pad_reg_13 <= #( delay_time) output_vector[i];
14: pad_reg_14 <= #( delay_time) output_vector[i];
15: pad_reg_15 <= #( delay_time) output_vector[i];
16: pad_reg_16 <= #( delay_time) output_vector[i];
17: pad_reg_17 <= #( delay_time) output_vector[i];
18: pad_reg_18 <= #( delay_time) output_vector[i];
19: pad_reg_19 <= #( delay_time) output_vector[i];
20: pad_reg_20 <= #( delay_time) output_vector[i];
21: pad_reg_21 <= #( delay_time) output_vector[i];
22: pad_reg_22 <= #( delay_time) output_vector[i];
23: pad_reg_23 <= #( delay_time) output_vector[i];
24: pad_reg_24 <= #( delay_time) output_vector[i];
25: pad_reg_25 <= #( delay_time) output_vector[i];
26: pad_reg_26 <= #( delay_time) output_vector[i];
27: pad_reg_27 <= #( delay_time) output_vector[i];
28: pad_reg_28 <= #( delay_time) output_vector[i];
29: pad_reg_29 <= #( delay_time) output_vector[i];
30: pad_reg_30 <= #( delay_time) output_vector[i];
31: pad_reg_31 <= #( delay_time) output_vector[i];
endcase
if (output_vector[i] !== 1'bz)
pad_d <= #( delay_time) 1'b1; // driving bidirect bus
end //pad_loop
end //if mask
end
pad_out_mask = 32'b0;
end
endtask // pad_out
task ppar_out;
input output_value;
input [127:0] delay_in;
input [31:0] skew_in;
integer delay[0:3];
integer delay_time, skew, i;
begin
delay[0] = delay_in[31:0];
delay[1] = delay_in[63:32];
delay[2] = delay_in[95:64];
delay[3] = delay_in[127:96];
skew = skew_in;
delay_time = delay[lmcver.map(output_value)] + model_times.tld_ppar + skew;
if (delay_time < 0) begin delay_time = 0; end
ppar_d = 1'b0; //init to input, not driving
begin : ppar_loop
if ((!x_transition_l) && (output_value === 1'bx)) begin disable ppar_loop; end
ppar_reg <= #( delay_time) output_value;
if (output_value !== 1'bz)
ppar_d <= #( delay_time) 1'b1; // driving bidirect pin
end //ppar_loop
end
endtask // ppar_out
task ptrdynn_out;
input output_value;
input [127:0] delay_in;
input [31:0] skew_in;
integer delay[0:3];
integer delay_time, skew, i;
begin
delay[0] = delay_in[31:0];
delay[1] = delay_in[63:32];
delay[2] = delay_in[95:64];
delay[3] = delay_in[127:96];
skew = skew_in;
delay_time = delay[lmcver.map(output_value)] + model_times.tld_ptrdynn + skew;
if (delay_time < 0) begin delay_time = 0; end
ptrdynn_d = 1'b0; //init to input, not driving
begin : ptrdynn_loop
if ((!x_transition_l) && (output_value === 1'bx)) begin disable ptrdynn_loop; end
ptrdynn_reg <= #( delay_time) output_value;
if (output_value !== 1'bz)
ptrdynn_d <= #( delay_time) 1'b1; // driving bidirect pin
end //ptrdynn_loop
end
endtask // ptrdynn_out
task pstopnn_out;
input output_value;
input [127:0] delay_in;
input [31:0] skew_in;
integer delay[0:3];
integer delay_time, skew, i;
begin
delay[0] = delay_in[31:0];
delay[1] = delay_in[63:32];
delay[2] = delay_in[95:64];
delay[3] = delay_in[127:96];
skew = skew_in;
delay_time = delay[lmcver.map(output_value)] + model_times.tld_pstopnn + skew;
if (delay_time < 0) begin delay_time = 0; end
pstopnn_d = 1'b0; //init to input, not driving
begin : pstopnn_loop
if ((!x_transition_l) && (output_value === 1'bx)) begin disable pstopnn_loop; end
pstopnn_reg <= #( delay_time) output_value;
if (output_value !== 1'bz)
pstopnn_d <= #( delay_time) 1'b1; // driving bidirect pin
end //pstopnn_loop
end
endtask // pstopnn_out
task pdevselnn_out;
input output_value;
input [127:0] delay_in;
input [31:0] skew_in;
integer delay[0:3];
integer delay_time, skew, i;
begin
delay[0] = delay_in[31:0];
delay[1] = delay_in[63:32];
delay[2] = delay_in[95:64];
delay[3] = delay_in[127:96];
skew = skew_in;
delay_time = delay[lmcver.map(output_value)] + model_times.tld_pdevselnn + skew;
if (delay_time < 0) begin delay_time = 0; end
begin : pdevselnn_loop
if ((!x_transition_l) && (output_value === 1'bx)) begin disable pdevselnn_loop; end
pdevselnn <= #( delay_time) output_value;
end //pdevselnn_loop
end
endtask // pdevselnn_out
task pd_out;
input [63:32] output_vector;
input [127:0] delay_in;
input [31:0] skew_in;
integer delay[0:3];
integer delay_time, skew, i;
begin
delay[0] = delay_in[31:0];
delay[1] = delay_in[63:32];
delay[2] = delay_in[95:64];
delay[3] = delay_in[127:96];
skew = skew_in;
pd_d = 1'b0; //init to input, not driving
for (i=32; i<=63; i=i+1) begin
if (pd_out_mask[i] !== 1'b1) begin
delay_time = delay[lmcver.map(output_vector[i])] + model_times.tld_pd[i] + skew;
if (delay_time < 0) begin delay_time = 0; end
begin : pd_loop
if ((!x_transition_l) && (output_vector[i] === 1'bx)) begin disable pd_loop; end
case (i)
32: pd_reg_32 <= #( delay_time) output_vector[i];
33: pd_reg_33 <= #( delay_time) output_vector[i];
34: pd_reg_34 <= #( delay_time) output_vector[i];
35: pd_reg_35 <= #( delay_time) output_vector[i];
36: pd_reg_36 <= #( delay_time) output_vector[i];
37: pd_reg_37 <= #( delay_time) output_vector[i];
38: pd_reg_38 <= #( delay_time) output_vector[i];
39: pd_reg_39 <= #( delay_time) output_vector[i];
40: pd_reg_40 <= #( delay_time) output_vector[i];
41: pd_reg_41 <= #( delay_time) output_vector[i];
42: pd_reg_42 <= #( delay_time) output_vector[i];
43: pd_reg_43 <= #( delay_time) output_vector[i];
44: pd_reg_44 <= #( delay_time) output_vector[i];
45: pd_reg_45 <= #( delay_time) output_vector[i];
46: pd_reg_46 <= #( delay_time) output_vector[i];
47: pd_reg_47 <= #( delay_time) output_vector[i];
48: pd_reg_48 <= #( delay_time) output_vector[i];
49: pd_reg_49 <= #( delay_time) output_vector[i];
50: pd_reg_50 <= #( delay_time) output_vector[i];
51: pd_reg_51 <= #( delay_time) output_vector[i];
52: pd_reg_52 <= #( delay_time) output_vector[i];
53: pd_reg_53 <= #( delay_time) output_vector[i];
54: pd_reg_54 <= #( delay_time) output_vector[i];
55: pd_reg_55 <= #( delay_time) output_vector[i];
56: pd_reg_56 <= #( delay_time) output_vector[i];
57: pd_reg_57 <= #( delay_time) output_vector[i];
58: pd_reg_58 <= #( delay_time) output_vector[i];
59: pd_reg_59 <= #( delay_time) output_vector[i];
60: pd_reg_60 <= #( delay_time) output_vector[i];
61: pd_reg_61 <= #( delay_time) output_vector[i];
62: pd_reg_62 <= #( delay_time) output_vector[i];
63: pd_reg_63 <= #( delay_time) output_vector[i];
endcase
if (output_vector[i] !== 1'bz)
pd_d <= #( delay_time) 1'b1; // driving bidirect bus
end //pd_loop
end //if mask
end
pd_out_mask = 32'b0;
end
endtask // pd_out
task ppar64_out;
input output_value;
input [127:0] delay_in;
input [31:0] skew_in;
integer delay[0:3];
integer delay_time, skew, i;
begin
delay[0] = delay_in[31:0];
delay[1] = delay_in[63:32];
delay[2] = delay_in[95:64];
delay[3] = delay_in[127:96];
skew = skew_in;
delay_time = delay[lmcver.map(output_value)] + model_times.tld_ppar64 + skew;
if (delay_time < 0) begin delay_time = 0; end
ppar64_d = 1'b0; //init to input, not driving
begin : ppar64_loop
if ((!x_transition_l) && (output_value === 1'bx)) begin disable ppar64_loop; end
ppar64_reg <= #( delay_time) output_value;
if (output_value !== 1'bz)
ppar64_d <= #( delay_time) 1'b1; // driving bidirect pin
end //ppar64_loop
end
endtask // ppar64_out
task pack64nn_out;
input output_value;
input [127:0] delay_in;
input [31:0] skew_in;
integer delay[0:3];
integer delay_time, skew, i;
begin
delay[0] = delay_in[31:0];
delay[1] = delay_in[63:32];
delay[2] = delay_in[95:64];
delay[3] = delay_in[127:96];
skew = skew_in;
delay_time = delay[lmcver.map(output_value)] + model_times.tld_pack64nn + skew;
if (delay_time < 0) begin delay_time = 0; end
begin : pack64nn_loop
if ((!x_transition_l) && (output_value === 1'bx)) begin disable pack64nn_loop; end
pack64nn <= #( delay_time) output_value;
end //pack64nn_loop
end
endtask // pack64nn_out
task pperrnn_out;
input output_value;
input [127:0] delay_in;
input [31:0] skew_in;
integer delay[0:3];
integer delay_time, skew, i;
begin
delay[0] = delay_in[31:0];
delay[1] = delay_in[63:32];
delay[2] = delay_in[95:64];
delay[3] = delay_in[127:96];
skew = skew_in;
delay_time = delay[lmcver.map(output_value)] + model_times.tld_pperrnn + skew;
if (delay_time < 0) begin delay_time = 0; end
begin : pperrnn_loop
if ((!x_transition_l) && (output_value === 1'bx)) begin disable pperrnn_loop; end
pperrnn <= #( delay_time) output_value;
end //pperrnn_loop
end
This page: |
Created: | Thu Aug 19 12:01:52 1999 |
| From: |
../../../sparc_v8/system/lmc/rtl/pcislave_fm.v
|