byteman  1.3 (Build #225)
Bitstream relocation and manipulation tool
Functions
inlineParseParams.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void parseParams (std::string params)
 

Function Documentation

◆ parseParams()

void parseParams ( std::string  params)
inline

Parses argument options for multiple operations.

  • params A list of parameters to control behavior:
    • "clock" or "clk" : Selects the clocks for operation.
    • "logic" or "clb" : Selects the blocktype 0 for operation.
    • "blockram" or "bram" : Selects the blockram contents for operation.
    • If neither clock, logic, or blockram are chosen, chooses all.
    • "blank" : Selects bitstream blanking (zeroing) operation.
    • "full" : Disabling partial selection.
    • "partial" : Writes only selected regions. Selected by default.
    • "set" : Selects SET operation.
    • "xor" : Selects bitwise XOR operation.
    • "or" : Selects bitwise OR operation.
    • "and" : Selects bitwise AND operation.

Definition at line 32 of file inlineParseParams.h.

32  {
33  selectedOptions = SelectedOptions();
34  selectedOptions.clk = false;
35  selectedOptions.clb = false;
36  selectedOptions.bram = false;
37  selectedOptions.blank = false;
38  selectedOptions.partialNotFull = true;
39  selectedOptions.op = MergeOP::SET;
40  selectedOptions.skipUnused = true;
41  selectedOptions.forceEndianness = false;
42  selectedOptions.word = false;
43  selectedOptions.intParam = 0;
44  replace(params.begin(), params.end(), ',', ' ');
45  std::stringstream ss(params);
46  std::string param;
47  while (!ss.eof()) {
48  ss >> param;
49  if(param == "clock" || param == "clk")selectedOptions.clk = true;
50  if(param == "logic" || param == "clb")selectedOptions.clb = true;
51  if(param == "blockram" || param == "bram")selectedOptions.bram = true;
52  if(param == "blank")selectedOptions.blank = true;
53  if(param == "full")selectedOptions.partialNotFull = false;
54  if(param == "partial")selectedOptions.partialNotFull = true;
55  if(param == "word")selectedOptions.word = true;
56  if(param == "set")selectedOptions.op = MergeOP::SET;
57  if(param == "xor")selectedOptions.op = MergeOP::XOR;
58  if(param == "or")selectedOptions.op = MergeOP::OR;
59  if(param == "and")selectedOptions.op = MergeOP::AND;
60  if(param == "bigendian"){
61  selectedOptions.forceEndianness = true;
62  selectedOptions.forcedEndianness = Endianness::BE;
63  }
64  if(param == "littleendian"){
65  selectedOptions.forceEndianness = true;
66  selectedOptions.forcedEndianness = Endianness::LE;
67  }
68  if(param == "bigendianwithbitswap"){
69  selectedOptions.forceEndianness = true;
70  selectedOptions.forcedEndianness = Endianness::BE_BS;
71  }
72  if(param == "littleendianwithbitswap"){
73  selectedOptions.forceEndianness = true;
74  selectedOptions.forcedEndianness = Endianness::LE_BS;
75  }
76  if(param == "nativeendian"){
77  selectedOptions.forceEndianness = true;
78  selectedOptions.forcedEndianness = Endianness::NATIVE;
79  }
80  param.clear();
81  }
82  if(!str::parse::multipleInts(params, selectedOptions.intParam))
83  selectedOptions.intParam = 0; //default 0 if there is nothing
84  if(!selectedOptions.clk && !selectedOptions.clb && !selectedOptions.bram){ // by default, choose all
85  selectedOptions.clk = selectedOptions.bram = selectedOptions.clb = true;
86  }
87 }
@ BE_BS
Big endian with bit swaps inside each byte.
@ LE_BS
Little endian with bit swaps inside each byte.
@ LE
Little endian ("LE" instead of full-er name, so it does not conflict with linux's reserved endianess ...
@ BE
Big endian ("BE" instead of full-er name, so it does not conflict with linux's reserved endianess wor...
@ NATIVE
System native will always be the fastest endianess to process.
bool multipleInts(std::stringstream &ss)
Definition: parse.h:192
std::string replace(std::string str, char oldChar, char newChar)
Replaces all instances of oldChar in string str with newChar and returns the resulting string.
Definition: str.h:41

References BE, BE_BS, LE, LE_BS, str::parse::multipleInts(), NATIVE, and str::replace().

Referenced by XilinxSeries7::blank(), XilinxUltraScale::blank(), XilinxUltraScalePlus::blank(), XilinxSeries7::change(), XilinxUltraScale::change(), XilinxUltraScalePlus::change(), XilinxSeries7::merge(), XilinxUltraScale::merge(), XilinxUltraScalePlus::merge(), XilinxSeries7::writeBitstream(), XilinxUltraScale::writeBitstream(), and XilinxUltraScalePlus::writeBitstream().

Here is the call graph for this function:
Here is the caller graph for this function: