本文整理汇总了C++中stream::full方法的典型用法代码示例。如果您正苦于以下问题:C++ stream::full方法的具体用法?C++ stream::full怎么用?C++ stream::full使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stream
的用法示例。
在下文中一共展示了stream::full方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeConverter
void writeConverter(stream<memCtrlWord> &memWrCmd, stream<ap_uint<memBusWidth> > &memWrData, stream<datamoverCtrlWord> &dmWrCmd, stream<axiWord> &dmWrData, stream<ap_uint<8> > &dmWrStatus) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS DATA_PACK variable=memWrCmd
#pragma HLS DATA_PACK variable=dmWrCmd
#pragma HLS DATA_PACK variable=dmWrData
#pragma HLS RESOURCE variable=memWrCmd core=AXI4Stream
#pragma HLS RESOURCE variable=memWrData core=AXI4Stream
#pragma HLS RESOURCE variable=dmWrCmd core=AXI4Stream
#pragma HLS RESOURCE variable=dmWrData core=AXI4Stream
#pragma HLS RESOURCE variable=dmWrStatus core=AXI4Stream
static ap_uint<4> tagCounter = 0;
static ap_uint<16> noOfBytesToWrite = 0;
static ap_uint<16> byteCount = 0;
static enum wcState{WRC_IDLE = 0, WRC_FWD, WRC_STATUS} writeConverterState;
switch(writeConverterState) {
case WRC_IDLE:
if (!memWrCmd.empty() && !dmWrCmd.full()) {
memCtrlWord writeTemp = memWrCmd.read();
ap_uint<32> convertedAddress = writeTemp.address * 64;
datamoverCtrlWord writeCtrlWord = {(writeTemp.count*(memBusWidth/8)), 1, 0, 1, 0, convertedAddress, tagCounter, 0};
noOfBytesToWrite = writeTemp.count;
dmWrCmd.write(writeCtrlWord);
tagCounter++;
writeConverterState = WRC_FWD;
}
break;
case WRC_FWD:
if (!memWrData.empty() && !dmWrData.full()) {
axiWord writeTemp2 = {0, 0xFFFFFFFFFFFFFFFF, 0};
memWrData.read(writeTemp2.data);
if (byteCount == noOfBytesToWrite - 1) {
writeTemp2.last = 1;
writeConverterState = WRC_STATUS;
byteCount = 0;
}
else
byteCount++;
dmWrData.write(writeTemp2);
}
break;
case WRC_STATUS:
if (!dmWrStatus.empty()) {
ap_uint<8> tempVariable = dmWrStatus.read();
writeConverterState = WRC_IDLE;
}
break;
}
}
示例2: readConverter
void readConverter(stream<memCtrlWord> &memRdCmd, stream<ap_uint<memBusWidth> > &memRdData, stream<datamoverCtrlWord> &dmRdCmd,
stream<axiWord> &dmRdData, stream<ap_uint<8> > &dmRdStatus) {
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS pipeline II=1 enable_flush
#pragma HLS DATA_PACK variable=memRdCmd
#pragma HLS DATA_PACK variable=dmRdCmd
#pragma HLS DATA_PACK variable=dmRdData
#pragma HLS RESOURCE variable=dmRdStatus core=AXI4Stream
#pragma HLS RESOURCE variable=memRdData core=AXI4Stream
#pragma HLS RESOURCE variable=dmRdCmd core=AXI4Stream
#pragma HLS RESOURCE variable=dmRdData core=AXI4Stream
#pragma HLS RESOURCE variable=memRdCmd core=AXI4Stream
static ap_uint<4> tagCounter = 0;
//static enum rcState{RDC_IDLE = 0, RDC_FWD, RDC_STATUS} readConverterState;
//switch(readConverterState) {
//case RDC_IDLE:
if (!memRdCmd.empty() && !dmRdCmd.full()) {
memCtrlWord readTemp = memRdCmd.read();
ap_uint<32> convertedAddress = readTemp.address * 64;
datamoverCtrlWord readCtrlWord = {(readTemp.count * (memBusWidth/8)), 1, 0, 1, 0, convertedAddress, tagCounter, 0};
//ap_uint<16> readCtrlWord = readTemp.address.range(15, 0);
dmRdCmd.write(readCtrlWord);
tagCounter++;
//readConverterState = RDC_FWD;
}
//break;
//case RDC_FWD:
if (!dmRdData.empty() && !memRdData.full()) {
axiWord readTemp = dmRdData.read();
memRdData.write(readTemp.data);
//if (readTemp.last)
//readConverterState = RDC_STATUS;
}
//break;
//case RDC_STATUS:
if (!dmRdStatus.empty()) {
ap_uint<8> tempVariable = dmRdStatus.read();
//readConverterState = RDC_IDLE;
}
//break;
}