Вот код формирования посылокк на ядро pcie s_axis_rq*.
Код
PIO_TX_DMA_START_DESC : begin // Запись в память ЭВМ (host cpu) дескриптора с начальным адрессом памяти для DMA
s_axis_rq_tvalid <= #TCQ 1'b1;
s_axis_rq_tlast <= #TCQ 1'b0;
s_axis_rq_tkeep <= #TCQ 8'hFF; // 4DW Descriptor and DW Payload For Memory Transaction
s_axis_rq_tdata <= #TCQ {DATA_TLP_IN[223:96], // 4DW Payload
1'b0, // Force ECRC
3'b000, // Attributes
3'b000, // Traffic Class
1'b0, // RID Enable to use the Client supplied Bus/Device/Func No
16'b0, // Completer -ID, set only for Completers or ID based routing
(AXISTEN_IF_ENABLE_CLIENT_TAG ?
8'h00 : req_tag), // Select Client Tag or core's internal tag
8'h00, // Req Bus No- used only when RID enable = 1
8'h00, // Req Dev/Func no - used only when RID enable = 1
1'b0, // Poisoned Req
4'b0011, // Req Type for MRd Req
11'h20, // DWORD Count
30'h0000_0000,
DATA_TLP_IN[255:224],// Memory Write cpu Address [62 bits]
2'b10}; //AT -> 00- Untranslated Address 10-> Translated Address
s_axis_rq_tuser <= #TCQ {(AXISTEN_IF_RQ_PARITY_CHECK ? s_axis_rq_tparity : 32'b0), // Parity
4'b1010, // Seq Number
8'h00, // TPH Steering Tag
1'b0, // TPH indirect Tag Enable
2'b0, // TPH Type
1'b0, // TPH Present
1'b0, // Discontinue
3'b000, // Byte Lane number in case of Address Aligned mode
4'hF, // Last BE of the Read Data
4'hF}; // First BE of the Read Data
if(s_axis_rq_tready) begin
state <= #TCQ PIO_TX_DMA_START_DW;
trn_sent <= #TCQ 1'b1;
cnt_tx_to_pci <= cnt_tx_to_pci +4;
end
else
state <= #TCQ PIO_TX_DMA_START_DESC;
end // PIO_TX_DMA_START_DESC
PIO_TX_DMA_START_DW : begin // Запись в память ЭВМ (host cpu) полезной информации из FIFO
s_axis_rq_tvalid <= #TCQ 1'b1;
s_axis_rq_tlast <= #TCQ 1'b0;
s_axis_rq_tkeep <= #TCQ 8'hFF; // 4DW Descriptor and DW Payload For Memory Transaction
s_axis_rq_tdata <= #TCQ DATA_TLP_IN; // 4DW Payload
s_axis_rq_tuser <= #TCQ {(AXISTEN_IF_RQ_PARITY_CHECK ? s_axis_rq_tparity : 32'b0), // Parity
4'b1010, // Seq Number
8'h00, // TPH Steering Tag
1'b0, // TPH indirect Tag Enable
2'b0, // TPH Type
1'b0, // TPH Present
1'b0, // Discontinue
3'b000, // Byte Lane number in case of Address Aligned mode
4'hF, // Last BE of the Read Data
4'hF}; // First BE of the Read Data
if(s_axis_rq_tready)
if(cnt_tx_to_pci < 20) begin
cnt_tx_to_pci <= cnt_tx_to_pci +8; // на шине 8DW
state <= #TCQ PIO_TX_DMA_START_DW;
trn_sent <= #TCQ 1'b1;
end
else
begin
state <= #TCQ PIO_TX_DMA_START_DW_END;
trn_sent <= #TCQ 1'b1;
end
else
state <= #TCQ PIO_TX_DMA_START_DW;
end // PIO_TX_DMA_START_DW
PIO_TX_DMA_START_DW_END: begin // завершаем передачу данных в ЭВМ для записи в память
s_axis_rq_tvalid <= #TCQ 1'b1;
s_axis_rq_tlast <= #TCQ 1'b1;
s_axis_rq_tkeep <= #TCQ 8'hF0; // 4DW Descriptor and DW Payload For Memory Transaction
s_axis_rq_tdata <= #TCQ DATA_TLP_IN; // 4DW Payload
s_axis_rq_tuser <= #TCQ {(AXISTEN_IF_RQ_PARITY_CHECK ? s_axis_rq_tparity : 32'b0), // Parity
4'b0000, // Seq Number
8'h00, // TPH Steering Tag
1'b0, // TPH indirect Tag Enable
2'b0, // TPH Type
1'b0, // TPH Present
1'b0, // Discontinue
3'b000, // Byte Lane number in case of Address Aligned mode
4'hF, // Last BE of the Read Data
4'hF}; // First BE of the Read Data
if(s_axis_rq_tready) begin
state <= #TCQ PIO_TX_RST_STATE;
trn_sent <= #TCQ 1'b1;
end
else
state <= #TCQ PIO_TX_DMA_START_DW_END;
end // PIO_TX_DMA_START_DW