📄 pci_exp_usrapp_tx.v
字号:
TSK_TX_SYNCHRONIZE(1, 0); trn_td <= #(Tcq) { COMPLETER_ID_CFG, 4'b0000, reg_addr_[11:2], 2'b00, 32'b0 }; trn_tsof_n <= #(Tcq) 1; trn_teof_n <= #(Tcq) 0; trn_trem_n <= #(Tcq) 8'h0F; trn_tsrc_rdy_n <= #(Tcq) 0 ; TSK_TX_SYNCHRONIZE(1, 1); trn_teof_n <= #(Tcq) 1; trn_trem_n <= #(Tcq) 0; trn_tsrc_rdy_n <= #(Tcq) 1; end endtask // TSK_TX_TYPE0_CONFIGURATION_READ /************************************************************ Task : TSK_TX_TYPE1_CONFIGURATION_READ Inputs : Tag, PCI/PCI-Express Reg Address, First BypeEn Outputs : Transaction Tx Interface Signaling Description : Generates a Type 1 Configuration Read TLP *************************************************************/ task TSK_TX_TYPE1_CONFIGURATION_READ; input [7:0] tag_; input [11:0] reg_addr_; input [3:0] first_dw_be_; begin if (trn_lnk_up_n) begin $display("[%t] : Trn interface is MIA", $realtime); $finish(1); end TSK_TX_SYNCHRONIZE(0, 0); trn_td <= #(Tcq) { 1'b0, 2'b00, 5'b00101, 1'b0, 3'b000, 4'b0000, 1'b0, 1'b0, 2'b00, 2'b00, 10'b0000000001, // 32 COMPLETER_ID_CFG, tag_, 4'b0000, first_dw_be_ // 64 }; trn_tsof_n <= #(Tcq) 0; trn_teof_n <= #(Tcq) 1; trn_trem_n <= #(Tcq) 0; trn_tsrc_rdy_n <= #(Tcq) 0 ; TSK_TX_SYNCHRONIZE(1, 0); trn_td <= #(Tcq) { COMPLETER_ID_CFG, 4'b0000, reg_addr_[11:2], 2'b00, 32'b0 }; trn_tsof_n <= #(Tcq) 1; trn_teof_n <= #(Tcq) 0; trn_trem_n <= #(Tcq) 8'h0F; trn_tsrc_rdy_n <= #(Tcq) 0 ; TSK_TX_SYNCHRONIZE(1, 1); trn_teof_n <= #(Tcq) 1; trn_trem_n <= #(Tcq) 0; trn_tsrc_rdy_n <= #(Tcq) 1; end endtask // TSK_TX_TYPE1_CONFIGURATION_READ /************************************************************ Task : TSK_TX_TYPE0_CONFIGURATION_WRITE Inputs : Tag, PCI/PCI-Express Reg Address, First BypeEn Outputs : Transaction Tx Interface Signaling Description : Generates a Type 0 Configuration Write TLP *************************************************************/ task TSK_TX_TYPE0_CONFIGURATION_WRITE; input [7:0] tag_; input [11:0] reg_addr_; input [31:0] reg_data_; input [3:0] first_dw_be_; begin if (trn_lnk_up_n) begin $display("[%t] : Trn interface is MIA", $realtime); $finish(1); end TSK_TX_SYNCHRONIZE(0, 0); trn_td <= #(Tcq) { 1'b0, 2'b10, 5'b00100, 1'b0, 3'b000, 4'b0000, 1'b0, 1'b0, 2'b00, 2'b00, 10'b0000000001, // 32 COMPLETER_ID_CFG, tag_, 4'b0000, first_dw_be_ // 64 }; trn_tsof_n <= #(Tcq) 0; trn_tsrc_rdy_n <= #(Tcq) 0 ; TSK_TX_SYNCHRONIZE(1, 0); trn_td <= #(Tcq) { COMPLETER_ID_CFG, 4'b0000, reg_addr_[11:2], 2'b00, // 32 reg_data_[7:0], reg_data_[15:8], reg_data_[23:16], reg_data_[31:24] // 64 }; trn_tsof_n <= #(Tcq) 1; trn_teof_n <= #(Tcq) 0; trn_trem_n <= #(Tcq) 8'h00; TSK_TX_SYNCHRONIZE(1, 1); trn_teof_n <= #(Tcq) 1; trn_trem_n <= #(Tcq) 0; trn_tsrc_rdy_n <= #(Tcq) 1; end endtask // TSK_TX_TYPE0_CONFIGURATION_WRITE /************************************************************ Task : TSK_TX_TYPE1_CONFIGURATION_WRITE Inputs : Tag, PCI/PCI-Express Reg Address, First BypeEn Outputs : Transaction Tx Interface Signaling Description : Generates a Type 1 Configuration Write TLP *************************************************************/ task TSK_TX_TYPE1_CONFIGURATION_WRITE; input [7:0] tag_; input [11:0] reg_addr_; input [31:0] reg_data_; input [3:0] first_dw_be_; begin if (trn_lnk_up_n) begin $display("[%t] : Trn interface is MIA", $realtime); $finish(1); end TSK_TX_SYNCHRONIZE(0, 0); trn_td <= #(Tcq) { 1'b0, 2'b10, 5'b00101, 1'b0, 3'b000, 4'b0000, 1'b0, 1'b0, 2'b00, 2'b00, 10'b0000000001, // 32 COMPLETER_ID_CFG, tag_, 4'b0000, first_dw_be_ // 64 }; trn_tsof_n <= #(Tcq) 0; trn_tsrc_rdy_n <= #(Tcq) 0 ; TSK_TX_SYNCHRONIZE(1, 0); trn_td <= #(Tcq) { COMPLETER_ID_CFG, 4'b0000, reg_addr_[11:2], 2'b00, // 32 reg_data_[7:0], reg_data_[15:8], reg_data_[23:16], reg_data_[31:24] // 64 }; trn_tsof_n <= #(Tcq) 1; trn_teof_n <= #(Tcq) 0; trn_trem_n <= #(Tcq) 8'h00; TSK_TX_SYNCHRONIZE(1, 1); trn_teof_n <= #(Tcq) 1; trn_trem_n <= #(Tcq) 0; trn_tsrc_rdy_n <= #(Tcq) 1; end endtask // TSK_TX_TYPE1_CONFIGURATION_WRITE /************************************************************ Task : TSK_TX_MEMORY_READ_32 Inputs : Tag, Length, Address, Last Byte En, First Byte En Outputs : Transaction Tx Interface Signaling Description : Generates a Memory Read 32 TLP *************************************************************/ task TSK_TX_MEMORY_READ_32; input [7:0] tag_; input [2:0] tc_; input [9:0] len_; input [31:0] addr_; input [3:0] last_dw_be_; input [3:0] first_dw_be_; begin if (trn_lnk_up_n) begin $display("[%t] : Trn interface is MIA", $realtime); $finish(1); end TSK_TX_SYNCHRONIZE(0, 0); trn_td <= #(Tcq) { 1'b0, 2'b00, 5'b00000, 1'b0, tc_, 4'b0000, 1'b0, 1'b0, 2'b00, 2'b00, len_, // 32 COMPLETER_ID_CFG, tag_, last_dw_be_, first_dw_be_ // 64 }; trn_tsof_n <= #(Tcq) 0; trn_teof_n <= #(Tcq) 1; trn_trem_n <= #(Tcq) 0; trn_tsrc_rdy_n <= #(Tcq) 0 ; TSK_TX_SYNCHRONIZE(1, 0); trn_td <= #(Tcq) { addr_[31:2], 2'b00, 32'b0 }; trn_tsof_n <= #(Tcq) 1; trn_teof_n <= #(Tcq) 0; trn_trem_n <= #(Tcq) 8'h0F; trn_tsrc_rdy_n <= #(Tcq) 0 ; TSK_TX_SYNCHRONIZE(1, 1); trn_teof_n <= #(Tcq) 1; trn_trem_n <= #(Tcq) 0; trn_tsrc_rdy_n <= #(Tcq) 1; end endtask // TSK_TX_MEMORY_READ_32 /************************************************************ Task : TSK_TX_MEMORY_READ_64 Inputs : Tag, Length, Address, Last Byte En, First Byte En Outputs : Transaction Tx Interface Signaling Description : Generates a Memory Read 64 TLP *************************************************************/ task TSK_TX_MEMORY_READ_64; input [7:0] tag_; input [2:0] tc_; input [9:0] len_; input [63:0] addr_; input [3:0] last_dw_be_; input [3:0] first_dw_be_; begin if (trn_lnk_up_n) begin $display("[%t] : Trn interface is MIA", $realtime); $finish(1); end TSK_TX_SYNCHRONIZE(0, 0); trn_td <= #(Tcq) { 1'b0, 2'b01, 5'b00000, 1'b0, tc_, 4'b0000, 1'b0, 1'b0, 2'b00, 2'b00, len_, // 32 COMPLETER_ID_CFG, tag_, last_dw_be_, first_dw_be_ // 64 }; trn_tsof_n <= #(Tcq) 0; trn_teof_n <= #(Tcq) 1; trn_trem_n <= #(Tcq) 0; trn_tsrc_rdy_n <= #(Tcq) 0 ; TSK_TX_SYNCHRONIZE(1, 0); trn_td <= #(Tcq) { addr_[63:2], 2'b00 }; trn_tsof_n <= #(Tcq) 1; trn_teof_n <= #(Tcq) 0; trn_trem_n <= #(Tcq) 8'h00; trn_tsrc_rdy_n <= #(Tcq) 0 ; TSK_TX_SYNCHRONIZE(1, 1); trn_teof_n <= #(Tcq) 1; trn_trem_n <= #(Tcq) 0; trn_tsrc_rdy_n <= #(Tcq) 1; end endtask // TSK_TX_MEMORY_READ_64
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -