diff --git a/src/tmltranslator/ctranslator/BaseBuffer.java b/src/tmltranslator/ctranslator/BaseBuffer.java index e0a3818895b2e3ccc8a7660d6ea014f2b6f9da8c..d362616567866d215189db72dcb2f1787be652e4 100755 --- a/src/tmltranslator/ctranslator/BaseBuffer.java +++ b/src/tmltranslator/ctranslator/BaseBuffer.java @@ -55,7 +55,7 @@ public class BaseBuffer extends Buffer { public static final int baseAddressIndex = 1; - protected static String baseAddressValue = USER_TO_DO; + protected String baseAddressValue = USER_TO_DO; protected static final String baseAddressType = "uint32_t*"; private String Context = "embb_mapper_context"; diff --git a/src/tmltranslator/ctranslator/Buffer.java b/src/tmltranslator/ctranslator/Buffer.java index 2548d3809a4db5662ff875e8aa019942643d21a6..dcec2fb06415f507282c52dc6c082fc8eecd09ba 100755 --- a/src/tmltranslator/ctranslator/Buffer.java +++ b/src/tmltranslator/ctranslator/Buffer.java @@ -60,6 +60,7 @@ public class Buffer { public static final int AdaifBuffer = 2; public static final int InterleaverBuffer = 3; public static final int MainMemoryBuffer = 4; + public static final int BaseBuffer = 5; public static final int bufferTypeIndex = 0; diff --git a/src/tmltranslator/ctranslator/FepBuffer.java b/src/tmltranslator/ctranslator/FepBuffer.java index 2dad75f8f40eb926dbf20a515d630915d3703e74..166469919f7109c3dc10d5863dbfa54c2e1260b0 100755 --- a/src/tmltranslator/ctranslator/FepBuffer.java +++ b/src/tmltranslator/ctranslator/FepBuffer.java @@ -64,13 +64,13 @@ public class FepBuffer extends Buffer { protected String numSamplesValue = USER_TO_DO; protected static final String numSamplesType = "uint8_t"; - protected static String baseAddressValue = USER_TO_DO; + protected String baseAddressValue = USER_TO_DO; protected static final String baseAddressType = "uint32_t*"; - protected static String bankValue = USER_TO_DO; + protected String bankValue = USER_TO_DO; protected static final String bankType = "uint8_t"; - protected static String dataTypeValue = USER_TO_DO; + protected String dataTypeValue = USER_TO_DO; protected static final String dataTypeType = "uint8_t"; public static final String DECLARATION = "extern struct FEP_BUFFER_TYPE {" + CR + TAB + diff --git a/src/tmltranslator/ctranslator/InterleaverBuffer.java b/src/tmltranslator/ctranslator/InterleaverBuffer.java index 22818600fd139a538d0ba25327c0eaed8e1ad08d..025bf2ec99da63026e179e94fdc49ab130351abb 100644 --- a/src/tmltranslator/ctranslator/InterleaverBuffer.java +++ b/src/tmltranslator/ctranslator/InterleaverBuffer.java @@ -67,33 +67,33 @@ public class InterleaverBuffer extends Buffer { public static final int offsetPermIntlIndex = 8; public static final int lengthPermIntlIndex = 9; - public static String packedBinaryInIntlValue; + public String packedBinaryInIntlValue = USER_TO_DO; public static String packedBinaryInIntlType = "bool"; - public static String widthIntlValue; + public String widthIntlValue = USER_TO_DO; public static String widthIntlType = "uint8_t"; - public static String bitInOffsetIntlValue; + public String bitInOffsetIntlValue = USER_TO_DO; public static String bitInOffsetIntlType = "uint8_t"; - public static String inputOffsetIntlValue; + public String inputOffsetIntlValue = USER_TO_DO; public static String inputOffsetIntlType = "uint16_t"; //data out - public static String packedBinaryOutIntlValue; + public String packedBinaryOutIntlValue = USER_TO_DO; public static String packedBinaryOutIntlType = "bool"; - public static String bitOutOffsetIntlValue; + public String bitOutOffsetIntlValue = USER_TO_DO; public static String bitOutOffsetIntlType = "uint8_t"; - public static String outputOffsetIntlValue; + public String outputOffsetIntlValue = USER_TO_DO; public static String outputOffsetIntlType = "uint16_t"; //permutation table - public static String offsetPermIntlValue; + public String offsetPermIntlValue = USER_TO_DO; public static String offsetPermIntlType = "uint16_t"; - public static String lengthPermIntlValue; + public String lengthPermIntlValue = USER_TO_DO; public static String lengthPermIntlType = "uint16_t"; public static final String DECLARATION = "extern struct INTERLEAVER_BUFFER_TYPE {" + CR + TAB + diff --git a/src/tmltranslator/ctranslator/IntlOperationMEC.java b/src/tmltranslator/ctranslator/IntlOperationMEC.java index d94d75b18b149882a1f0439dc0f656b7c69ececb..250cf9d524259043ef70e5d503f5550740d8a5ac 100644 --- a/src/tmltranslator/ctranslator/IntlOperationMEC.java +++ b/src/tmltranslator/ctranslator/IntlOperationMEC.java @@ -47,7 +47,6 @@ package tmltranslator.ctranslator;; import java.util.*; -//import Ctranslator.*; public class IntlOperationMEC extends OperationMEC { @@ -61,23 +60,17 @@ public class IntlOperationMEC extends OperationMEC { "void init_" + ctxName.split("_ctx")[0] + "(void){" + CR + TAB + "intl_ctx_init(&" + ctxName + ", (uint64_t) /*USER TODO: value*/);" + CR + TAB + "// initialize context" + CR + TAB + - "intl_set_op(&" + ctxName + ", FEP_OP_MOV);" + CR + TAB + - "intl_set_sv( (((INTL_BUFF_TYPE*)sig[" + ID0 + "].pBuff)->base_address), (uint64_t) /* USER TODO: value */);" + CR + TAB + - "intl_set_arm( (((INTL_BUFF_TYPE*)sig[" + ID0 + "].pBuff)->base_address), (uint64_t) /* USER TODO: value */);" + CR + TAB + - "intl_set_re( (((INTL_BUFF_TYPE*)sig[" + ID0 + "].pBuff)->base_address), (uint64_t) /* USER TODO: value */);" + CR + TAB + - "intl_set_se( (((INTL_BUFF_TYPE*)sig[" + ID0 + "].pBuff)->base_address), (uint64_t) /* USER TODO: value */);" + CR + TAB + - "intl_set_fe( (((INTL_BUFF_TYPE*)sig[" + ID0 + "].pBuff)->base_address), (uint64_t) /* USER TODO: value */);" + CR + TAB + - "intl_set_pbo( (((INTL_BUFF_TYPE*)sig[" + ID0 + "].pBuff)->base_address), (uint64_t) /* USER TODO: value */);" + CR + TAB + - "intl_set_pbi( (((INTL_BUFF_TYPE*)sig[" + ID0 + "].pBuff)->base_address), (uint64_t) /* USER TODO: value */);" + CR + TAB + - "intl_set_widm1( (((INTL_BUFF_TYPE*)sig[" + ID0 + "].pBuff)->base_address), (uint64_t) /* USER TODO: value */);" + CR + TAB + - "intl_set_biof( (((INTL_BUFF_TYPE*)sig[" + ID0 + "].pBuff)->base_address), (uint64_t) /* USER TODO: value */);" + CR + TAB + - "intl_set_boof( (((INTL_BUFF_TYPE*)sig[" + ID0 + "].pBuff)->base_address), (uint64_t) /* USER TODO: value */);" + CR + TAB + - "intl_set_fz( (((INTL_BUFF_TYPE*)sig[" + ID0 + "].pBuff)->base_address), (uint64_t) /* USER TODO: value */);" + CR + TAB + - "intl_set_fo( (((INTL_BUFF_TYPE*)sig[" + ID0 + "].pBuff)->base_address), (uint64_t) /* USER TODO: value */);" + CR + TAB + - "intl_set_iof( (((INTL_BUFF_TYPE*)sig[" + ID0 + "].pBuff)->base_address), (uint64_t) /* USER TODO: value */);" + CR + TAB + - "intl_set_oof( (((INTL_BUFF_TYPE*)sig[" + ID0 + "].pBuff)->base_address), (uint64_t) /* USER TODO: value */);" + CR + TAB + - "intl_set_pof( (((INTL_BUFF_TYPE*)sig[" + ID0 + "].pBuff)->base_address), (uint64_t) /* USER TODO: value */);" + CR + TAB + - "intl_set_lenm1( (((INTL_BUFF_TYPE*)sig[" + ID0 + "].pBuff)->base_address), (uint64_t) /* USER TODO: value */);" + CR + TAB + + "intl_set_lenm1( (((INTL_BUFF_TYPE*)sig[" + ID0 + "].pBuff)->num_symbols), (uint64_t) /* USER TODO: value */);" + CR + TAB + + "intl_set_lba( (((INTL_BUFF_TYPE*)sig[" + ID0 + "].pBuff)->lut_base_address), (uint64_t) /* USER TODO: value */);" + CR + TAB + + "intl_set_oba( (((INTL_BUFF_TYPE*)sig[" + ID0 + "].pBuff)->output_base_address), (uint64_t) /* USER TODO: value */);" + CR + TAB + + "intl_set_iba( (((INTL_BUFF_TYPE*)sig[" + ID0 + "].pBuff)->input_base_address), (uint64_t) /* USER TODO: value */);" + CR + TAB + + "intl_set_mult( /* USER TO DO */, (uint64_t) /* USER TODO: value */);" + CR + TAB + + "intl_set_men( /* USER TO DO */, (uint64_t) /* USER TODO: value */);" + CR + TAB + + "intl_set_sym( (((INTL_BUFF_TYPE*)sig[" + ID0 + "].pBuff)->symmetrical_value), (uint64_t) /* USER TODO: value */);" + CR + TAB + + "intl_set_bpsm1( (((INTL_BUFF_TYPE*)sig[" + ID0 + "].pBuff)->num_bits_per_symbol), (uint64_t) /* USER TODO: value */);" + CR + TAB + + "intl_set_m( (((INTL_BUFF_TYPE*)sig[" + ID0 + "].pBuff)->base_address), (uint64_t) /* USER TODO: value */);" + CR + TAB + + "intl_set_n( /* USER TO DO */, (uint64_t) /* USER TODO: value */);" + CR + TAB + + "intl_set_s( /* USER TO DO */, (uint64_t) /* USER TODO: value */);" + CR + TAB + "}" + CR; cleanup_code = "intl_ctx_cleanup(&" + ctxName + ");"; } diff --git a/src/tmltranslator/ctranslator/MMBuffer.java b/src/tmltranslator/ctranslator/MMBuffer.java index bca6d61df0bedbaec8e06ff536d2285a13ac63b2..b44e29a3e256d7dfd78c6b86ac3284ddfbf04b3a 100644 --- a/src/tmltranslator/ctranslator/MMBuffer.java +++ b/src/tmltranslator/ctranslator/MMBuffer.java @@ -57,10 +57,10 @@ public class MMBuffer extends Buffer { public static final int numSamplesIndex = 1; public static final int baseAddressIndex = 2; - protected static String numSamplesValue = USER_TO_DO; + protected String numSamplesValue = USER_TO_DO; protected static final String numSamplesType = "uint8_t"; - protected static String baseAddressValue = USER_TO_DO; + protected String baseAddressValue = USER_TO_DO; protected static final String baseAddressType = "uint32_t*"; public static final String DECLARATION = "extern struct MM_BUFFER_TYPE {" + CR + TAB + diff --git a/src/tmltranslator/ctranslator/MapperBuffer.java b/src/tmltranslator/ctranslator/MapperBuffer.java index c9e7b460f4ab79c2d1066a0378bfc9a6e39b2d94..d1780196af14d7f199a286584d78d40a53098e56 100644 --- a/src/tmltranslator/ctranslator/MapperBuffer.java +++ b/src/tmltranslator/ctranslator/MapperBuffer.java @@ -54,33 +54,42 @@ import tmltranslator.*; public class MapperBuffer extends Buffer { public static final String[] symmetricalValues = { "OFF" , "ON" }; - public static final int numSamplesIndex = 1; - public static final int baseAddressIndex = 2; - public static final int bitsPerSymbolIndex = 3; - public static final int bitOffsetFirstSymbolIndex = 4; - public static final int symmetricalIndex = 5; - - protected static String numSamplesValue = USER_TO_DO; - protected static final String numSamplesType = "uint8_t"; - - protected static String baseAddressValue = USER_TO_DO; - protected static final String baseAddressType = "uint32_t*"; - - protected static String bitsPerSymbolValue = USER_TO_DO; - protected static final String bitsPerSymbolType = "uint8_t"; - - protected static String bitOffsetFirstSymbolValue = USER_TO_DO; - protected static final String bitOffsetFirstSymbolType = "uint16_t*"; - protected static String symmetricalValue = USER_TO_DO; - protected static final String symmetricalValueType = "bool"; + //data in + public static final int numSamplesDataInMappIndex = 1; + protected String numSamplesDataInMappValue = USER_TO_DO; + public static final String numSamplesDataInMappType = "uint16_t"; + + public static final int baseAddressDataInMappIndex = 2; + protected String baseAddressDataInMappValue = USER_TO_DO; + public static final String baseAddressDataInMappType = "uint16_t*"; + + public static final int bitsPerSymbolDataInMappIndex = 3; + protected String bitsPerSymbolDataInMappValue = USER_TO_DO; + public static final String bitsPerSymbolDataInMappType = "uint16_t"; + + public static int symmetricalValueDataInMappIndex = 4; + protected String symmetricalValueDataInMapp = USER_TO_DO; + protected static final String symmetricalValueDataInMappType = "bool"; + + //data out + public static final int baseAddressDataOutMappIndex = 5; + protected String baseAddressDataOutMappValue = USER_TO_DO; + public static final String baseAddressDataOutMappType = "uint16_t*"; + + //Look up table + public static final int baseAddressLUTMappIndex = 6; + protected String baseAddressLUTMappValue = USER_TO_DO; + public static final String baseAddressLUTMappType = "uint16_t*"; + public static final String DECLARATION = "extern struct MAPPER_BUFFER_TYPE {" + CR + TAB + - numSamplesType + SP + "num_symbols" + SC + CR + TAB + - baseAddressType + SP + "base_address" + SC + CR + TAB + - bitsPerSymbolType + SP + "num_bits_symbol" + SC + CR + TAB + - bitOffsetFirstSymbolType + SP + "bit_offset_first_symbol" + SC + CR + TAB + - symmetricalValueType + SP + "symmetrical_value" + SC + CR + "};"; + numSamplesDataInMappType + SP + "num_symbols" + SC + CR + TAB + + baseAddressDataInMappType + SP + "input_base_address" + SC + CR + TAB + + bitsPerSymbolDataInMappType + SP + "num_bits_symbol" + SC + CR + TAB + + symmetricalValueDataInMappType + SP + "symmetrical_value" + SC + CR + TAB + + baseAddressDataOutMappType + SP + "output_base_address" + SC + CR + TAB + + baseAddressLUTMappType + SP + "lut_base_address" + SC + CR + "}"; private String Context = "embb_mapper_context"; @@ -95,41 +104,46 @@ public class MapperBuffer extends Buffer { if( bufferParameters != null ) { retrieveBufferParameters(); } - s.append( TAB + name + ".num_symbols = " + numSamplesValue + SC + CR ); - s.append( TAB + name + ".base_address = " + baseAddressValue + SC + CR ); - s.append( TAB + name + ".num_bits_per_symbol = " + bitsPerSymbolValue + SC + CR ); - s.append( TAB + name + ".bit_offset_first_symbol = " + bitOffsetFirstSymbolValue + SC + CR ); - s.append( TAB + name + ".symmetrical_value = " + symmetricalValue + SC + CR ); + s.append( TAB + name + ".num_symbols = " + numSamplesDataInMappValue + SC + CR ); + s.append( TAB + name + ".input_base_address = " + baseAddressDataInMappValue + SC + CR ); + s.append( TAB + name + ".num_bits_per_symbol = " + bitsPerSymbolDataInMappValue + SC + CR ); + s.append( TAB + name + ".symmetrical_value = " + symmetricalValueDataInMapp + SC + CR ); + s.append( TAB + name + ".output_base_address = " + baseAddressDataOutMappValue + SC + CR ); + s.append( TAB + name + ".lut_base_address = " + baseAddressLUTMappValue + SC + CR ); return s.toString(); } public String toString() { StringBuffer s = new StringBuffer( super.toString() ); - s.append( TAB2 + "num_symbols = " + numSamplesValue + SC + CR ); - s.append( TAB2 + "base_address = " + baseAddressValue + SC + CR ); - s.append( TAB2 + "num_bits_per_symbol = " + bitsPerSymbolValue + SC + CR ); - s.append( TAB2 + "bit_offset_first_symbol = " + bitsPerSymbolValue + SC + CR ); - s.append( TAB2 + "symmetrical_value = " + symmetricalValue + SC + CR ); + s.append( TAB2 + "num_symbols = " + numSamplesDataInMappValue + SC + CR ); + s.append( TAB2 + "input_base_address = " + baseAddressDataInMappValue + SC + CR ); + s.append( TAB2 + "num_bits_per_symbol = " + bitsPerSymbolDataInMappValue + SC + CR ); + s.append( TAB2 + "symmetrical_value = " + symmetricalValueDataInMapp + SC + CR ); + s.append( TAB2 + "output_base_address = " + baseAddressDataOutMappValue + SC + CR ); + s.append( TAB2 + "lut_base_address = " + baseAddressLUTMappValue + SC + CR ); return s.toString(); } private void retrieveBufferParameters() { - if( bufferParameters.get( numSamplesIndex ).length() > 0 ) { - numSamplesValue = bufferParameters.get( numSamplesIndex ); + if( bufferParameters.get( numSamplesDataInMappIndex ).length() > 0 ) { + numSamplesDataInMappValue = bufferParameters.get( numSamplesDataInMappIndex ); + } + if( bufferParameters.get( baseAddressDataInMappIndex ).length() > 0 ) { + baseAddressDataInMappValue = bufferParameters.get( baseAddressDataInMappIndex ); } - if( bufferParameters.get( baseAddressIndex ).length() > 0 ) { - baseAddressValue = bufferParameters.get( baseAddressIndex ); + if( bufferParameters.get( bitsPerSymbolDataInMappIndex ).length() > 0 ) { + bitsPerSymbolDataInMappValue = bufferParameters.get( bitsPerSymbolDataInMappIndex ); } - if( bufferParameters.get( bitsPerSymbolIndex ).length() > 0 ) { - bitsPerSymbolValue = bufferParameters.get( bitsPerSymbolIndex ); + if( bufferParameters.get( symmetricalValueDataInMappIndex ).length() > 0 ) { + symmetricalValueDataInMapp = String.valueOf( ( new Vector<String>( Arrays.asList( symmetricalValues ))).indexOf( bufferParameters.get( symmetricalValueDataInMappIndex ))); } - if( bufferParameters.get( bitOffsetFirstSymbolIndex ).length() > 0 ) { - bitOffsetFirstSymbolValue = bufferParameters.get( bitOffsetFirstSymbolIndex ); + if( bufferParameters.get( baseAddressDataOutMappIndex ).length() > 0 ) { + baseAddressDataOutMappValue = bufferParameters.get( baseAddressDataOutMappIndex ); } - if( bufferParameters.get( symmetricalIndex ).length() > 0 ) { - symmetricalValue = String.valueOf( ( new Vector<String>( Arrays.asList( symmetricalValues ))).indexOf( bufferParameters.get( symmetricalIndex ))); + if( bufferParameters.get( baseAddressLUTMappIndex ).length() > 0 ) { + baseAddressLUTMappValue = bufferParameters.get( baseAddressLUTMappIndex ); } } diff --git a/src/ui/tmldd/TMLArchiPortArtifact.java b/src/ui/tmldd/TMLArchiPortArtifact.java index f4954bdada00532708846aafd90e8725497c1b42..d007cee71f0f9a231195c35377540ddd846e1544 100644 --- a/src/ui/tmldd/TMLArchiPortArtifact.java +++ b/src/ui/tmldd/TMLArchiPortArtifact.java @@ -292,11 +292,15 @@ public class TMLArchiPortArtifact extends TGCWithoutInternalComponent implements sb.append("\" numSamples=\"" + bufferParameters.get( MMBuffer.numSamplesIndex ) ); break; case Buffer.MapperBuffer: - sb.append("\" baseAddress=\"" + bufferParameters.get( MapperBuffer.baseAddressIndex ) ); - sb.append("\" numSamples=\"" + bufferParameters.get( MapperBuffer.numSamplesIndex ) ); - sb.append("\" bitsPerSymbol=\"" + bufferParameters.get( MapperBuffer.bitsPerSymbolIndex ) ); - sb.append("\" bitOffsetFirstSymbol=\"" + bufferParameters.get( MapperBuffer.bitOffsetFirstSymbolIndex ) ); - sb.append("\" symmetricalValue=\"" + bufferParameters.get( MapperBuffer.symmetricalIndex ) ); + //data in + sb.append("\" numSamplesDataInMapp=\"" + bufferParameters.get( MapperBuffer.numSamplesDataInMappIndex ) ); + sb.append("\" baseAddressDataInMapp=\"" + bufferParameters.get( MapperBuffer.baseAddressDataInMappIndex ) ); + sb.append("\" bitsPerSymbolDataInMapp=\"" + bufferParameters.get( MapperBuffer.bitsPerSymbolDataInMappIndex ) ); + sb.append("\" symmetricalValueDataInMapp=\"" + bufferParameters.get( MapperBuffer.symmetricalValueDataInMappIndex ) ); + //data out + sb.append("\" baseAddressDataOutMapp=\"" + bufferParameters.get( MapperBuffer.baseAddressDataOutMappIndex ) ); + //Look-up Table + sb.append("\" baseAddressLUTMapp=\"" + bufferParameters.get( MapperBuffer.baseAddressLUTMappIndex ) ); break; case Buffer.MainMemoryBuffer: sb.append("\" baseAddress=\"" + bufferParameters.get( MMBuffer.baseAddressIndex ) ); @@ -370,11 +374,15 @@ public class TMLArchiPortArtifact extends TGCWithoutInternalComponent implements bufferParameters.add( elt.getAttribute( "numSamples" ) ); break; case Buffer.MapperBuffer: - bufferParameters.add( elt.getAttribute( "baseAddress" ) ); - bufferParameters.add( elt.getAttribute( "numSamples" ) ); - bufferParameters.add( elt.getAttribute( "bitsPerSymbol" ) ); - bufferParameters.add( elt.getAttribute( "bitOffsetFirstSymbol" ) ); - bufferParameters.add( elt.getAttribute( "symmetricalValue" ) ); + //data in + bufferParameters.add( elt.getAttribute( "numSamplesDataInMapp" ) ); + bufferParameters.add( elt.getAttribute( "baseAddressDataInMapp" ) ); + bufferParameters.add( elt.getAttribute( "bitsPerSymbolDataInMapp" ) ); + bufferParameters.add( elt.getAttribute( "symmetricalValueDataInMapp" ) ); + //data out + bufferParameters.add( elt.getAttribute( "baseAddressDataOutMapp" ) ); + //Look-up Table + bufferParameters.add( elt.getAttribute( "baseAddressLUTMapp" ) ); break; case Buffer.MainMemoryBuffer: bufferParameters.add( elt.getAttribute( "baseAddress" ) ); diff --git a/src/ui/window/JDialogPortArtifact.java b/src/ui/window/JDialogPortArtifact.java index 8e3d19749e41cdf05d1f6aa5d3f1fb84f79cf57c..59120deac7fce1fd105907b72040f33f6b93dd1e 100755 --- a/src/ui/window/JDialogPortArtifact.java +++ b/src/ui/window/JDialogPortArtifact.java @@ -70,8 +70,8 @@ public class JDialogPortArtifact extends javax.swing.JDialog implements ActionLi private String mappedMemory = "VOID"; protected JComboBox referenceCommunicationName, priority, memoryCB; - protected JTextField baseAddressTF, numSamplesTF, bitOffsetFirstSymbolTF, bitsPerSymbolTF; - protected String baseAddress, mappedPort, sampleLength, numSamples, bitOffsetFirstSymbol, bitsPerSymbol; + protected JTextField baseAddressTF, numSamplesTF, bitsPerSymbolTF; + protected String baseAddress, mappedPort, sampleLength, numSamples, bitsPerSymbol; protected String bank, dataType, symmetricalValue; protected JComboBox dataTypeCB, bankCB, symmetricalValueCB; @@ -90,15 +90,15 @@ public class JDialogPortArtifact extends javax.swing.JDialog implements ActionLi protected String lengthPermIntl, offsetPermIntl; //Mapper Data In - protected JTextField baseAddressDataInMapp_TF, numSamplesDataInMapp_TF, bitsPerSymbolDataInMapp_TF, bitOffsetFirstSymbolDataInMapp_TF; - protected String baseAddressDataInMapp, numSamplesDataInMapp, bitsPerSymbolDataInMapp, bitOffsetFirstSymbolDataInMapp, symmetricalValueDataInMapp; + protected JTextField baseAddressDataInMapp_TF, numSamplesDataInMapp_TF, bitsPerSymbolDataInMapp_TF; + protected String baseAddressDataInMapp, numSamplesDataInMapp, bitsPerSymbolDataInMapp, symmetricalValueDataInMapp; protected JComboBox symmetricalValueDataInMapp_CB; //Mapper Data Out - protected JTextField baseAddressDataOutMapp_TF, numSamplesDataOutMapp_TF; - protected String baseAddressDataOutMapp, numSamplesDataOutMapp; + protected JTextField baseAddressDataOutMapp_TF; + protected String baseAddressDataOutMapp; //Mapper LUT - protected JTextField numSamplesLUTMapp_TF, baseAddressLUTMapp_TF; - protected String numSamplesLUTMapp, baseAddressLUTMapp; + protected JTextField baseAddressLUTMapp_TF; + protected String baseAddressLUTMapp; // Main Panel private JButton closeButton; @@ -283,11 +283,15 @@ public class JDialogPortArtifact extends javax.swing.JDialog implements ActionLi break; case Buffer.MapperBuffer: if( loadBufferParameters ) { - baseAddress = bufferParameters.get( MapperBuffer.baseAddressIndex ); - numSamples = bufferParameters.get( MapperBuffer.numSamplesIndex ); - bitsPerSymbol = bufferParameters.get( MapperBuffer.bitsPerSymbolIndex ); - bitOffsetFirstSymbol = bufferParameters.get( MapperBuffer.bitOffsetFirstSymbolIndex ); - symmetricalValue = bufferParameters.get( MapperBuffer.symmetricalIndex ); + //data in + numSamplesDataInMapp = bufferParameters.get( MapperBuffer.numSamplesDataInMappIndex ); + baseAddressDataInMapp = bufferParameters.get( MapperBuffer.baseAddressDataInMappIndex ); + bitsPerSymbolDataInMapp = bufferParameters.get( MapperBuffer.bitsPerSymbolDataInMappIndex ); + symmetricalValueDataInMapp = bufferParameters.get( MapperBuffer.symmetricalValueDataInMappIndex ); + //data out + baseAddressDataOutMapp = bufferParameters.get( MapperBuffer.baseAddressDataOutMappIndex ); + //look-up table + baseAddressLUTMapp = bufferParameters.get( MapperBuffer.baseAddressLUTMappIndex ); } makeMapperBufferPanel( c1, c2 ); break; @@ -496,11 +500,6 @@ public class JDialogPortArtifact extends javax.swing.JDialog implements ActionLi c1.gridwidth = GridBagConstraints.REMAINDER; panel3.add( bitsPerSymbolDataInMapp_TF, c1 ); // - bitOffsetFirstSymbolDataInMapp_TF = new JTextField( bitOffsetFirstSymbolDataInMapp, 5 ); - panel3.add( new JLabel( "Bit offset of first symbol = "), c2 ); - c1.gridwidth = GridBagConstraints.REMAINDER; - panel3.add( bitOffsetFirstSymbolDataInMapp_TF, c1 ); - // symmetricalValueDataInMapp_CB = new JComboBox( new Vector<String>( Arrays.asList( MapperBuffer.symmetricalValues ) ) ); panel3.add( new JLabel( "Symmetrical value = "), c2 ); c1.gridwidth = GridBagConstraints.REMAINDER; @@ -510,24 +509,12 @@ public class JDialogPortArtifact extends javax.swing.JDialog implements ActionLi panel3.add( symmetricalValueDataInMapp_CB, c1 ); //Data Out panel - c2.anchor = GridBagConstraints.LINE_START; - numSamplesDataOutMapp_TF = new JTextField( numSamplesDataOutMapp, 5 ); - panel4.add( new JLabel( "Number of symbols = "), c2 ); - c1.gridwidth = GridBagConstraints.REMAINDER; - panel4.add( numSamplesDataOutMapp_TF, c1 ); - // baseAddressDataOutMapp_TF = new JTextField( baseAddressDataOutMapp, 5 ); panel4.add( new JLabel( "Base address = "), c2 ); c1.gridwidth = GridBagConstraints.REMAINDER; panel4.add( baseAddressDataOutMapp_TF, c1 ); // //Look Up Table panel - c2.anchor = GridBagConstraints.LINE_START; - numSamplesLUTMapp_TF = new JTextField( numSamplesLUTMapp, 5 ); - panel5.add( new JLabel( "Number of symbols = "), c2 ); - c1.gridwidth = GridBagConstraints.REMAINDER; - panel5.add( numSamplesLUTMapp_TF, c1 ); - // baseAddressLUTMapp_TF = new JTextField( baseAddressLUTMapp, 5 ); panel5.add( new JLabel( "Base address = "), c2 ); c1.gridwidth = GridBagConstraints.REMAINDER; @@ -671,11 +658,30 @@ public class JDialogPortArtifact extends javax.swing.JDialog implements ActionLi private void flushBuffersStrings() { + //interleaver + widthIntl = ""; + bitInOffsetIntl = ""; + inputOffsetIntl = ""; + packedBinaryInIntl = ""; + packedBinaryOutIntl = ""; + bitOutOffsetIntl = ""; + outputOffsetIntl = ""; + lengthPermIntl = ""; + offsetPermIntl = ""; + + //mapper + baseAddressDataInMapp = ""; + numSamplesDataInMapp = ""; + bitsPerSymbolDataInMapp = ""; + symmetricalValueDataInMapp = ""; + baseAddressDataOutMapp = ""; + baseAddressLUTMapp = ""; + + //other buffers baseAddress = ""; mappedPort = ""; sampleLength = ""; numSamples = ""; - bitOffsetFirstSymbol = ""; bitsPerSymbol = ""; symmetricalValue = ""; } @@ -728,30 +734,22 @@ public class JDialogPortArtifact extends javax.swing.JDialog implements ActionLi } private boolean handleClosureWhenSelectedFepBuffer() { - return checkBaseAddress() && checkNumSamples(); } private boolean handleClosureWhenSelectedInterleaverBuffer() { - - // need to add the code to check for all 3 tabs return checkDI_Intl() && checkDO_Intl() && CheckPerm_Intl(); } private boolean handleClosureWhenSelectedAdaifBuffer() { - return checkBaseAddress() && checkNumSamples(); } private boolean handleClosureWhenSelectedMapperBuffer() { - - // need to add the code to check for all 3 tabs - symmetricalValue = (String)symmetricalValueCB.getSelectedItem(); - return checkBaseAddress() && checkNumSamples() && checkNumBitsPerSymbol() && checkSymbolBaseAddress(); + return checkDI_Mapper() && checkDO_Mapper() && checkLUT_Mapper(); } private boolean handleClosureWhenSelectedMainMemoryBuffer() { - return checkBaseAddress(); } @@ -846,10 +844,84 @@ public class JDialogPortArtifact extends javax.swing.JDialog implements ActionLi } return true; } + + private boolean checkLUT_Mapper() { + + baseAddressLUTMapp = (String) baseAddressLUTMapp_TF.getText(); + if( baseAddressLUTMapp.length() <= 2 && baseAddressLUTMapp.length() > 0 ) { + JOptionPane.showMessageDialog( frame, "Please enter a valid base address", "Badly formatted parameter", + JOptionPane.INFORMATION_MESSAGE ); + return false; + } + if( baseAddressLUTMapp.length() > 2 ) { + if( !( baseAddressLUTMapp.substring(0,2).equals("0x") || baseAddressLUTMapp.substring(0,2).equals("0X") ) ) { + JOptionPane.showMessageDialog( frame, "Base address must be expressed in hexadecimal", "Badly formatted parameter", + JOptionPane.INFORMATION_MESSAGE ); + return false; + } + } + return true; + } + + private boolean checkDI_Mapper() { + + numSamplesDataInMapp = (String)numSamplesDataInMapp_TF.getText(); + baseAddressDataInMapp = (String)baseAddressDataInMapp_TF.getText(); + bitsPerSymbolDataInMapp = (String)bitsPerSymbolDataInMapp_TF.getText(); + symmetricalValueDataInMapp = (String)symmetricalValueDataInMapp_CB.getSelectedItem(); + String regex = "[0-9]+"; + + if( baseAddressDataInMapp.length() <= 2 && baseAddressDataInMapp.length() > 0 ) { + JOptionPane.showMessageDialog( frame, "Please enter a valid base address", "Badly formatted parameter", + JOptionPane.INFORMATION_MESSAGE ); + return false; + } + if( baseAddressDataInMapp.length() > 2 ) { + if( !( baseAddressDataInMapp.substring(0,2).equals("0x") || baseAddressDataInMapp.substring(0,2).equals("0X") ) ) { + JOptionPane.showMessageDialog( frame, "Base address must be expressed in hexadecimal", "Badly formatted parameter", + JOptionPane.INFORMATION_MESSAGE ); + return false; + } + } + if( !( numSamplesDataInMapp.length() > 0 ) ) { + return true; + } + if( !numSamplesDataInMapp.matches( regex ) ) { + JOptionPane.showMessageDialog( frame, "The number of bits/symbol must be expressed as a natural", "Badly formatted parameter", + JOptionPane.INFORMATION_MESSAGE ); + return false; + } + if( !( bitsPerSymbolDataInMapp.length() > 0 ) ) { + return true; + } + if( !bitsPerSymbolDataInMapp.matches( regex ) ) { + JOptionPane.showMessageDialog( frame, "The number of bits/symbol must be expressed as a natural", "Badly formatted parameter", + JOptionPane.INFORMATION_MESSAGE ); + return false; + } + return true; + } + + private boolean checkDO_Mapper() { + + baseAddressDataOutMapp = (String)baseAddressDataOutMapp_TF.getText(); + if( baseAddressDataOutMapp.length() <= 2 && baseAddressDataOutMapp.length() > 0 ) { + JOptionPane.showMessageDialog( frame, "Please enter a valid base address", "Badly formatted parameter", + JOptionPane.INFORMATION_MESSAGE ); + return false; + } + if( baseAddressDataOutMapp.length() > 2 ) { + if( !( baseAddressDataOutMapp.substring(0,2).equals("0x") || baseAddressDataOutMapp.substring(0,2).equals("0X") ) ) { + JOptionPane.showMessageDialog( frame, "Base address must be expressed in hexadecimal", "Badly formatted parameter", + JOptionPane.INFORMATION_MESSAGE ); + return false; + } + } + return true; + } private boolean checkDI_Intl() { - String regex = "[0-9]+"; widthIntl = (String)widthIntl_TF.getText(); bitInOffsetIntl = (String)bitInOffsetIntl_TF.getText(); @@ -860,7 +932,7 @@ public class JDialogPortArtifact extends javax.swing.JDialog implements ActionLi return true; } if( !widthIntl.matches( regex ) ) { - JOptionPane.showMessageDialog( frame, "The samples widthmust be expressed as a natural", "Badly formatted parameter", + JOptionPane.showMessageDialog( frame, "The samples width must be expressed as a natural", "Badly formatted parameter", JOptionPane.INFORMATION_MESSAGE ); return false; } @@ -1018,24 +1090,6 @@ public class JDialogPortArtifact extends javax.swing.JDialog implements ActionLi return true; } - private boolean checkSymbolBaseAddress() { - - bitOffsetFirstSymbol = (String) bitOffsetFirstSymbolTF.getText(); - if( bitOffsetFirstSymbol.length() <= 2 && bitOffsetFirstSymbol.length() > 0 ) { - JOptionPane.showMessageDialog( frame, "Please enter a valid symbol base address", "Badly formatted parameter", - JOptionPane.INFORMATION_MESSAGE ); - return false; - } - if( bitOffsetFirstSymbol.length() > 2 ) { - if( !( bitOffsetFirstSymbol.substring(0,2).equals("0x") || bitOffsetFirstSymbol.substring(0,2).equals("0X") ) ) { - JOptionPane.showMessageDialog( frame, "Bit offset of first symbol must be expressed in hexadecimal", "Badly formatted parameter", - JOptionPane.INFORMATION_MESSAGE ); - return false; - } - } - return true; - } - public ArrayList<String> getBufferParameters() { ArrayList<String> params = new ArrayList<String>(); @@ -1061,16 +1115,20 @@ public class JDialogPortArtifact extends javax.swing.JDialog implements ActionLi params.add( InterleaverBuffer.offsetPermIntlIndex, offsetPermIntl ); params.add( InterleaverBuffer.lengthPermIntlIndex, lengthPermIntl ); break; - case Buffer.AdaifBuffer: + case Buffer.BaseBuffer: params.add( baseAddress ); params.add( numSamples ); break; case Buffer.MapperBuffer: - params.add( baseAddress ); - params.add( numSamples ); - params.add( bitsPerSymbol ); - params.add( bitOffsetFirstSymbol ); - params.add( symmetricalValue ); + //data in + params.add( MapperBuffer.numSamplesDataInMappIndex, numSamplesDataInMapp ); + params.add( MapperBuffer.baseAddressDataInMappIndex, baseAddressDataInMapp ); + params.add( MapperBuffer.bitsPerSymbolDataInMappIndex, bitsPerSymbolDataInMapp ); + params.add( MapperBuffer.symmetricalValueDataInMappIndex, symmetricalValueDataInMapp ); + //data out + params.add( MapperBuffer.baseAddressDataOutMappIndex, baseAddressDataOutMapp ); + //look-up table + params.add( MapperBuffer.baseAddressLUTMappIndex, baseAddressLUTMapp ); break; case Buffer.MainMemoryBuffer: params.add( baseAddress );