byteman  1.3 (Build #225)
Bitstream relocation and manipulation tool
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
byteman Class Reference

#include "byteman.h"

Collaboration diagram for byteman:
Collaboration graph
[legend]

Classes

struct  SelectedOptions
 

Public Types

enum class  Architecture {
  Unknown , Xilinx_Series6 , Xilinx_Series7 , Xilinx_UltraScale ,
  Xilinx_UltraScalePlus , Xilinx_Versal
}
 

Public Member Functions

 byteman ()
 
void help ()
 
void help (std::string)
 
void help (std::string, int)
 
void helpAssembly (bool=false)
 
void helpBlank (bool=false)
 
void helpChange (bool=false)
 
void helpDevice (bool=false)
 
void helpExit (bool=false)
 
void helpHelp (bool=false)
 
void helpInput (bool=false)
 
void helpMerge (bool=false)
 
void helpOutput (bool=false)
 
void helpRegion (bool=false)
 
void helpStdin (bool=false)
 
void helpVerbose (bool=false)
 
void helpWarn (bool=false)
 
void parse (std::string)
 
void parseAssembly (std::string)
 
void parseBlank (std::string)
 
void parseChange (std::string)
 
void parseDevice (std::string)
 
void parseInput (std::string)
 
void parseMerge (std::string)
 
void parseOutput (std::string)
 
std::string parseParamsAndRemoveThemFromString (std::string)
 
void parseRegion (std::string)
 
void parseTest (std::string)
 
void parseVerbose (std::string)
 
void parseWarn (std::string)
 
void setArchitecture (std::string)
 
virtual ~byteman ()
 

Public Attributes

struct byteman::SelectedOptions options
 
enum byteman::Architecture selectedArchitecture = Architecture::Unknown
 

Detailed Description

Definition at line 52 of file byteman.h.

Member Enumeration Documentation

◆ Architecture

enum byteman::Architecture
strong
Enumerator
Unknown 
Xilinx_Series6 
Xilinx_Series7 
Xilinx_UltraScale 
Xilinx_UltraScalePlus 
Xilinx_Versal 

Definition at line 69 of file byteman.h.

69  {
70  Unknown,
71  Xilinx_Series6,
72  Xilinx_Series7,
73  Xilinx_UltraScale,
74  Xilinx_UltraScalePlus,
75  Xilinx_Versal
enum byteman::Architecture selectedArchitecture

Constructor & Destructor Documentation

◆ byteman()

byteman::byteman ( )

Definition at line 76 of file byteman.cpp.

76  {
77  #ifdef XS7
78  mainXS7.instanceName = "Main Xil S7";
79  tempXS7.instanceName = "Temp Xil S7";
80  #endif //XS7
81 
82  #ifdef XUS
83  mainXUS.instanceName = "Main Xil US";
84  tempXUS.instanceName = "Temp Xil US";
85  #endif //XUS
86 
87  #ifdef XUSP
88  mainXUSP.instanceName = "Main Xil US+ ";
89  tempXUSP.instanceName = "Temp Xil US+ ";
90  #endif //XUSP
91 }

◆ ~byteman()

byteman::~byteman ( )
virtual

Definition at line 92 of file byteman.cpp.

92  {
93 
94 }

Member Function Documentation

◆ help() [1/3]

void byteman::help ( )

Definition at line 40 of file help.cpp.

41 {
42  std::cout << "Usage:" << std::endl;
43  std::cout << " " EXECUTABLE " ARCH [-command...]* [-stdin]" << std::endl;
44  std::cout << std::endl;
45  std::cout << " ARCH = {\"Xilinx Series 7\"/\"XS7\", \"Xilinx UltraScale\"/\"XUS\", \"Xilinx UltraScale+ \"/\"XUSP\"}" << std::endl;
46  std::cout << std::endl;
47  std::cout << "Commands: : [Description] " << std::endl;
48  std::cout << " -a (Assembly) : (de)assemble bitstreams. see \"-help assembly\"" << std::endl;
49  std::cout << " -b (Blank) : erases bitstream buffers. see \"-help blank\"" << std::endl;
50  std::cout << " -c (Change) : modify bitstream. see \"-help change\"" << std::endl;
51  std::cout << " -d (Device) : manually select target device. see \"-help device\"" << std::endl;
52  std::cout << " -e (Exit) : exit byteman. used with stdin. see \"-help exit\"" << std::endl;
53  std::cout << " -h (Help) : get help. see \"-help help\"" << std::endl;
54  std::cout << " -i (Input) : input bitstream. see \"-help input\"" << std::endl;
55  std::cout << " -m (Merge) : merge bitstreams. see \"-help merge\"" << std::endl;
56  std::cout << " -o (Output) : output bitstream. see \"-help output\"" << std::endl;
57  std::cout << " -r (Region) : modify region selection. see \"-help region\"" << std::endl;
58  std::cout << " -s (Stdin) : continue using standard input. see \"-help stdin\"" << std::endl;
59  std::cout << " -v (Verbose) : enable/disable spam. see \"-help verbose\"" << std::endl;
60  std::cout << " -w (Warn) : enable/disable warnings. see \"-help warn\"" << std::endl;
61  std::cout << std::endl;
62  std::cout << "Examples: " << std::endl;
63  std::cout << " " EXECUTABLE " Xilinx US+ -w -i main static.bit -i temp filter.bit -merge logic 180:67 120:30 240:37 -o logic 240:37 120:30 relocatedFilter.bit" << std::endl;
64  std::cout << " " EXECUTABLE " XUSP -w -d ZCU 102 -b main, logic, blockram -i temp filter.bit -merge logic 180:67 120:30 180:67 -o logic 180:67 120:30 mergedFilter.bit" << std::endl;
65  std::cout << std::endl;
66  std::cout << "Need more help? Try one of these:" << std::endl;
67  std::cout << " " EXECUTABLE " -help <command>" << std::endl;
68  std::cout << " " EXECUTABLE " -help all" << std::endl;
69  std::cout << " " EXECUTABLE " Xilinx Series 7 -help all" << std::endl;
70  std::cout << " " EXECUTABLE " Xilinx UltraScale -help all" << std::endl;
71  std::cout << " " EXECUTABLE " Xilinx UltraScale+ -help all" << std::endl;
72 }
#define EXECUTABLE
Definition: help.cpp:29

References EXECUTABLE.

Referenced by help().

Here is the caller graph for this function:

◆ help() [2/3]

void byteman::help ( std::string  param)

Definition at line 73 of file help.cpp.

74 {
75  if(str::iff::stringIs(param, "all")){
76  help();
78  byteman::helpBlank(true);
79  byteman::helpChange(true);
80  byteman::helpDevice(true);
81  byteman::helpExit(true);
82  byteman::helpHelp(true);
83  byteman::helpInput(true);
84  byteman::helpMerge(true);
85  byteman::helpOutput(true);
86  byteman::helpRegion(true);
87  byteman::helpStdin(true);
89  byteman::helpWarn(true);
90  } else if(str::iff::stringIs(param, "v", "verbose"))
92  else if(str::iff::stringIs(param, "w", "warn"))
94  else if(str::iff::stringIs(param, "r", "region"))
96  else if(str::iff::stringIs(param, "b", "blank"))
98  else if(str::iff::stringIs(param, "c", "change"))
100  else if(str::iff::stringIs(param, "d", "device"))
102  else if(str::iff::stringIs(param, "h", "help"))
104  else if(str::iff::stringIs(param, "i", "input"))
106  else if(str::iff::stringIs(param, "m", "merge"))
108  else if(str::iff::stringIs(param, "o", "output"))
110  else if(str::iff::stringIs(param, "a", "assembly"))
112  else if(str::iff::stringIs(param, "e", "exit"))
114  else if(str::iff::stringIs(param, "s", "stdin"))
116  else {
117  std::cout << "Unknown command to help you with: \"" << param << "\"!" << std::endl;
118  std::cout << "Try one of \"assembly\", \"blank\", \"change\", \"device\", \"exit\", \"help\", \"input\", \"merge\", \"output\", \"region\", \"stdin\", \"verbose\", \"warn\" maybe?" << std::endl;
119  std::cout << std::endl;
120  }
121 }
void helpVerbose(bool=false)
Definition: help.cpp:122
void helpBlank(bool=false)
Definition: help.cpp:195
void helpStdin(bool=false)
Definition: help.cpp:448
void helpDevice(bool=false)
Definition: help.cpp:259
void helpMerge(bool=false)
Definition: help.cpp:348
void helpExit(bool=false)
Definition: help.cpp:440
void helpOutput(bool=false)
Definition: help.cpp:379
void helpHelp(bool=false)
Definition: help.cpp:293
void help()
Definition: help.cpp:40
void helpWarn(bool=false)
Definition: help.cpp:146
void helpAssembly(bool=false)
Definition: help.cpp:409
void helpChange(bool=false)
Definition: help.cpp:224
void helpRegion(bool=false)
Definition: help.cpp:170
void helpInput(bool=false)
Definition: help.cpp:327
bool stringIs(std::string checkedString)
Returns false. End of recursion for template.
Definition: iff.h:45

References help(), helpAssembly(), helpBlank(), helpChange(), helpDevice(), helpExit(), helpHelp(), helpInput(), helpMerge(), helpOutput(), helpRegion(), helpStdin(), helpVerbose(), helpWarn(), and str::iff::stringIs().

Here is the call graph for this function:

◆ help() [3/3]

void byteman::help ( std::string  param,
int  exitCode 
)

Definition at line 31 of file help.cpp.

32 {
33  std::cout << "byteman " << VERSION << " (Build #" << VERSION_BUILD << ", compiled on " << __DATE__ << " " << __TIME__ << ")" << std::endl;
34  if(param.empty())
35  byteman::help();
36  else
37  byteman::help(param);
38  exit(exitCode);
39 }

References help().

Referenced by main().

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

◆ helpAssembly()

void byteman::helpAssembly ( bool  selectedAll = false)

Definition at line 409 of file help.cpp.

410 {
411  if(selectedAll)
412  std::cout << "byteman: Assembly" << std::endl;
413  std::cout << " assembles and disassembles between bitstream files (.bit|.bin) and bitstream assembly (.bitasm) format." << std::endl;
414  std::cout << std::endl;
415  std::cout << " Usage:" << std::endl;
416  std::cout << " " EXECUTABLE " -assembly <InputBitstreamFileName> <OutputAssemblyFileName>" << std::endl;
417  std::cout << " " EXECUTABLE " -assembly <InputAssemblyFileName> <OutputBitstreamFileName>" << std::endl;
418  std::cout << " Args:" << std::endl;
419  std::cout << " <InputBitstreamFileName>: name of the input bitstream file. supports \".bit\" and \".bin\" file formats." << std::endl;
420  std::cout << " <OutputBitstreamFileName>: name of the output bitstream file. supports \".bit\" and \".bin\" file formats." << std::endl;
421  std::cout << " <InputAssemblyFileName>: name of the input assembly file. supports \".bitasm\" file format." << std::endl;
422  std::cout << " <OutputAssemblyFileName>: name of the output assembly file. supports \".bitasm\" file format." << std::endl;
423  std::cout << std::endl;
424  std::cout << " the bitstream assembly files can be edited and converted back to valid bitstreams." << std::endl;
425  std::cout << " in bitstream assembly file format:" << std::endl;
426  std::cout << " every line that doesn't start with '#' is editable." << std::endl;
427  std::cout << " bitstream commands are written one per line and have the format \"<COMMAND NAME>;\"" << std::endl;
428  std::cout << " bitstream register writesare one per line and have the format \"@<REGNAME> = <NEW REG VALUE>\"" << std::endl;
429  std::cout << std::endl;
430  std::cout << " Examples:" << std::endl;
431  std::cout << " " EXECUTABLE " XUSP -assembly bitstream.bit bitstream.bitasm" << std::endl;
432  std::cout << std::endl;
433  std::cout << " " EXECUTABLE " Xilinx Series 7 -a bitstream.bitasm bitstream.bit" << std::endl;
434  std::cout << std::endl;
435  std::cout << " # Generate a bitstream file and then convert it to bit assembly:" << std::endl;
436  std::cout << " " EXECUTABLE " Xilinx US -... -o bitstreamOut.bit -a bitstreamOut.bit bitstreamOut.bitasm" << std::endl;
437  std::cout << std::endl;
438  std::cout << std::endl;
439 }

References EXECUTABLE.

Referenced by help().

Here is the caller graph for this function:

◆ helpBlank()

void byteman::helpBlank ( bool  selectedAll = false)

Definition at line 195 of file help.cpp.

196 {
197  if(selectedAll)
198  std::cout << "byteman: Blank" << std::endl;
199  std::cout << " erases/sets the bitstream in the buffers. uses the list of selected regions (see \"-help Region\"). if the list is empty, works on the whole chip." << std::endl;
200  std::cout << std::endl;
201  std::cout << " Usage:" << std::endl;
202  std::cout << " " EXECUTABLE " -blank [First] [Second] [Logic] [Clock] [BlockRAM] [<BlankValue>]" << std::endl;
203  std::cout << std::endl;
204  std::cout << " Args:" << std::endl;
205  std::cout << " [First]: selects the first of the two bitstream buffers. Enabled by default if no buffer is explicitly specified." << std::endl;
206  std::cout << " [Second]: selects the second of the two bitstream buffers." << std::endl;
207  std::cout << " [Logic]: selects the data excluding global clock from logic plane of the bitstream. Enabled by default if no plane is explicitly specified." << std::endl;
208  std::cout << " [Clock]: selects the global clock data from logic plane of the bitstream. Enabled by default if no plane is explicitly specified." << std::endl;
209  std::cout << " [BlockRAM]: selects the blockram contents plane of the bitstream. Enabled by default if no plane is explicitly specified." << std::endl;
210  std::cout << " [<BlankValue>]: byte value (0-255) to be written in the selected bitstream location. Default is 0." << std::endl;
211  std::cout << std::endl;
212  std::cout << " Examples:" << std::endl;
213  std::cout << " # Blanks the bitstream's logic plane to zeroes:" << std::endl;
214  std::cout << " " EXECUTABLE " XUSP -blank main clb" << std::endl;
215  std::cout << std::endl;
216  std::cout << " # All values in the rectangle describing Y from 100 to 149 and X from 7 to 21 are set to 0xA5A5A5A5:" << std::endl;
217  std::cout << " " EXECUTABLE " Xilinx Series 7 -r add 100:7 50:15 -b 0xA5" << std::endl;
218  std::cout << std::endl;
219  std::cout << " # Blanks the bitstream to zeroes:" << std::endl;
220  std::cout << " " EXECUTABLE " Xilinx US -b" << std::endl;
221  std::cout << std::endl;
222  std::cout << std::endl;
223 }

References EXECUTABLE.

Referenced by help().

Here is the caller graph for this function:

◆ helpChange()

void byteman::helpChange ( bool  selectedAll = false)

Definition at line 224 of file help.cpp.

225 {
226  if(selectedAll)
227  std::cout << "byteman: Change" << std::endl;
228  std::cout << " modifies bitstream data." << std::endl;
229  std::cout << std::endl;
230  std::cout << " Usage:" << std::endl;
231  std::cout << " " EXECUTABLE " -change [First] [Second] [BigEndian, LittleEndian, BigEndianWithBitSwap, LittleEndianWithBitSwap, NativeEndian] [word <Y>:<X> <blockType> <frameOffset> <wordOffset> <mask> <value>]" << std::endl;
232  std::cout << std::endl;
233  std::cout << " Args:" << std::endl;
234  std::cout << " [First]: selects the first of the two bitstream buffers. Enabled by default if no buffer is explicitly specified." << std::endl;
235  std::cout << " [Second]: selects the second of the two bitstream buffers." << std::endl;
236  std::cout << " [BigEndian]: forces the stored bitstream data is in Big Endian format. any future operations will inherit the endianness (such as -Output)" << std::endl;
237  std::cout << " [LittleEndian]: forces the stored bitstream data is in Little Endian format. any future operations will inherit the endianness (such as -Output)" << std::endl;
238  std::cout << " [BigEndianWithBitSwap]: forces the stored bitstream data is in Big Endian with Bit Swap format. any future operations will inherit the endianness (such as -Output)" << std::endl;
239  std::cout << " [LittleEndianWithBitSwap]: forces the stored bitstream data is in Little Endian with Bit Swap format. any future operations will inherit the endianness (such as -Output)" << std::endl;
240  std::cout << " [NativeEndian]: forces the stored bitstream data is in the native endianness of the system. any future operations will inherit the endianness (such as -Output)" << std::endl;
241  std::cout << " [word <Y>:<X> <blockType> <frameOffset> <wordOffset> <mask> <value>]: forces bitstream value <value> (masked by <mask>) to a word located at coordinates <Y>:<X> in block <blockType>" << std::endl;
242  std::cout << " : with internal offsets for the frame <frameOffset> and word <wordOffset>" << std::endl;
243  std::cout << std::endl;
244  std::cout << " Examples:" << std::endl;
245  std::cout << " # reads a bitstream, forces big endianness, writes back the bitstream in the new endianness:" << std::endl;
246  std::cout << " " EXECUTABLE " XUS -input bitstream.bit -change bigEndian -output full bitstream.bit" << std::endl;
247  std::cout << " # reads a bitstream, forces little endianness, writes back the bitstream in the new endianness:" << std::endl;
248  std::cout << " " EXECUTABLE " xilinx series 7 -input boot.bin -change LITTLEendian -output full boot.bin" << std::endl;
249  std::cout << " # load a partial bitstream located at 180:0. targetting the third blockram left to right, located at 180:37." << std::endl;
250  std::cout << " # modify its routing at the 3rd frame (frame offset 2) at the 41-st word (word offset 40) to value 0xA5A50000 (masked by 0xFFFF0000). (the blockram routing is located in CLB block Type - blockType 0):" << std::endl;
251  std::cout << " " EXECUTABLE " xilinx UltraScale+ -device ZCU102 -input pr.bit -change word 180:37 0 2 40 0xFFFF0000 0xA5A50000 -output ..." << std::endl;
252  std::cout << " # load a partial bitstream located at 180:0. targetting the second blockram left to right, located at 180:37." << std::endl;
253  std::cout << " # modify contents at the 233rd frame (frame offset 232) at the 5-th word (word offset 4) to value 0xFFFFFFFF (masked by 0xFFFFFFFF). (the blockram contents are located in blockType 1):" << std::endl;
254  std::cout << " " EXECUTABLE " xilinx UltraScale+ -device ZCU102 -input pr.bit -change word 180:37 1 232 4 0xFFFFFFFF 0xFFFFFFFF -output ..." << std::endl;
255  std::cout << std::endl;
256  std::cout << std::endl;
257  std::cout << std::endl;
258 }

References EXECUTABLE.

Referenced by help().

Here is the caller graph for this function:

◆ helpDevice()

void byteman::helpDevice ( bool  selectedAll = false)

Definition at line 259 of file help.cpp.

260 {
261  if(selectedAll)
262  std::cout << "byteman: Device" << std::endl;
263  std::cout << " Sets the target device manually." << std::endl;
264  std::cout << std::endl;
265  std::cout << " Usage:" << std::endl;
266  std::cout << " " EXECUTABLE " -device [First] [Second] <DeviceName>" << std::endl;
267  std::cout << std::endl;
268  std::cout << " Args:" << std::endl;
269  std::cout << " [First]: selects the first of the two bitstream buffers. Enabled by default if no buffer is explicitly specified." << std::endl;
270  std::cout << " [Second]: selects the second of the two bitstream buffers." << std::endl;
271  std::cout << " <DeviceName>: name of the target chip, package, or board." << std::endl;
272  std::cout << std::endl;
273  std::cout << " Examples:" << std::endl;
274  std::cout << " " EXECUTABLE " XUSP -device Alveo U200" << std::endl;
275  std::cout << " " EXECUTABLE " Xilinx Series 7 -d Wizarde" << std::endl;
276  std::cout << " " EXECUTABLE " Xilinx US -d xcvu440" << std::endl;
277  std::cout << std::endl;
278  #ifdef XS7
280  mainXS7.deviceHelp();
281  #endif
282  #ifdef XUS
284  mainXUS.deviceHelp();
285  #endif
286  #ifdef XUSP
288  mainXUSP.deviceHelp();
289  #endif
290  std::cout << std::endl;
291  std::cout << std::endl;
292 }

References EXECUTABLE, selectedArchitecture, Unknown, Xilinx_Series7, Xilinx_UltraScale, and Xilinx_UltraScalePlus.

Referenced by help().

Here is the caller graph for this function:

◆ helpExit()

void byteman::helpExit ( bool  selectedAll = false)

Definition at line 440 of file help.cpp.

441 {
442  if(selectedAll)
443  std::cout << "byteman: Exit" << std::endl;
444  std::cout << " finishes execution of byteman. used with STDin mode (see \"-help STDin\") to identify the end of command sequence." << std::endl;
445  std::cout << std::endl;
446  std::cout << std::endl;
447 }

Referenced by help().

Here is the caller graph for this function:

◆ helpHelp()

void byteman::helpHelp ( bool  selectedAll = false)

Definition at line 293 of file help.cpp.

294 {
295  if(selectedAll)
296  std::cout << "byteman: Help" << std::endl;
297  std::cout << " prints these messages... help messages can change if architecture and/or specific device is selected to incorporate more information!" << std::endl;
298  std::cout << std::endl;
299  std::cout << " Usage:" << std::endl;
300  std::cout << " " EXECUTABLE " -help [Command]" << std::endl;
301  std::cout << std::endl;
302  std::cout << " Arg:" << std::endl;
303  std::cout << " [Command]: prints extra information about the usage of a specific command." << std::endl;
304  std::cout << std::endl;
305  std::cout << " Examples:" << std::endl;
306  std::cout << " " EXECUTABLE " Xilinx US+ -device Alveo U200 -help device #will print extra information about the selected device" << std::endl;
307  std::cout << " " EXECUTABLE " Xilinx US+ -input bitfile.bit -help device #will print extra information about the bitstream device" << std::endl;
308  std::cout << " " EXECUTABLE " -help" << std::endl;
309  std::cout << " " EXECUTABLE " XUSP -h" << std::endl;
310  std::cout << " " EXECUTABLE " Xilinx Series 7 -h" << std::endl;
311  std::cout << " " EXECUTABLE " Xilinx US -h" << std::endl;
312  std::cout << " " EXECUTABLE " -help help" << std::endl;
313  std::cout << " " EXECUTABLE " -help assembly" << std::endl;
314  std::cout << " " EXECUTABLE " -help blank" << std::endl;
315  std::cout << " " EXECUTABLE " -help change" << std::endl;
316  std::cout << " " EXECUTABLE " -help end" << std::endl;
317  std::cout << " " EXECUTABLE " -help input" << std::endl;
318  std::cout << " " EXECUTABLE " -help merge" << std::endl;
319  std::cout << " " EXECUTABLE " -help region" << std::endl;
320  std::cout << " " EXECUTABLE " -help output" << std::endl;
321  std::cout << " " EXECUTABLE " -help verbose" << std::endl;
322  std::cout << " " EXECUTABLE " -help warn" << std::endl;
323  std::cout << " " EXECUTABLE " -help device" << std::endl;
324  std::cout << std::endl;
325  std::cout << std::endl;
326 }

References EXECUTABLE.

Referenced by help().

Here is the caller graph for this function:

◆ helpInput()

void byteman::helpInput ( bool  selectedAll = false)

Definition at line 327 of file help.cpp.

328 {
329  if(selectedAll)
330  std::cout << "byteman: Input" << std::endl;
331  std::cout << " reads a bitstream from a file." << std::endl;
332  std::cout << std::endl;
333  std::cout << " Usage:" << std::endl;
334  std::cout << " " EXECUTABLE " -input [First] [Second] <InputFileName>" << std::endl;
335  std::cout << std::endl;
336  std::cout << " Args:" << std::endl;
337  std::cout << " [First]: selects the first of the two bitstream buffers. Enabled by default if no buffer is explicitly specified." << std::endl;
338  std::cout << " [Second]: selects the second of the two bitstream buffers." << std::endl;
339  std::cout << " <InputFileName>: name of the input file. supports \".bit\" and \".bin\" file formats." << std::endl;
340  std::cout << std::endl;
341  std::cout << " Examples:" << std::endl;
342  std::cout << " " EXECUTABLE " XUSP -i main zcu102bitstream.bit" << std::endl;
343  std::cout << " " EXECUTABLE " Xilinx Series 7 -input zedboardBitstream.bin" << std::endl;
344  std::cout << " " EXECUTABLE " Xilinx US -i xcvu440Bitstream.bit" << std::endl;
345  std::cout << std::endl;
346  std::cout << std::endl;
347 }

References EXECUTABLE.

Referenced by help().

Here is the caller graph for this function:

◆ helpMerge()

void byteman::helpMerge ( bool  selectedAll = false)

Definition at line 348 of file help.cpp.

349 {
350  if(selectedAll)
351  std::cout << "byteman: Merge" << std::endl;
352  std::cout << " merges portion of the bitstream in the second buffer into the first buffer." << std::endl;
353  std::cout << std::endl;
354  std::cout << " Usage:" << std::endl;
355  std::cout << " " EXECUTABLE " -merge [Logic] [BlockRAM] [Clock] [SET, XOR, OR, AND] [Full, <SrcY> <SrcX> <SizeY> <SizeX> <DstY> <DstX>]" << std::endl;
356  std::cout << std::endl;
357  std::cout << " Args:" << std::endl;
358  std::cout << " [Logic]: selects the data from the logic plane of the bitstream. Enabled by default if no plane is explicitly specified." << std::endl;
359  std::cout << " [Clock]: selects the global clock data from the logic plane of the bitstream. Enabled by default if no plane is explicitly specified." << std::endl;
360  std::cout << " [BlockRAM]: selects the BlockRAM contents plane of the bitstream. Enabled by default if no plane is explicitly specified." << std::endl;
361  std::cout << " [SET, XOR, OR, AND]: selects merge operation. XOR, OR, AND are bitwise operations. Default is \"SET\"." << std::endl;
362  std::cout << " [Full]: selects the full device bitstream." << std::endl;
363  std::cout << " [<SrcY> <SrcX> <SizeY> <SizeX> <DstY> <DstX>]: selects a rect (<SrcY> <SrcX> <SizeY> <SizeX>) from the second bitstream buffer to be merged" << std::endl;
364  std::cout << " : into destination rect (<DstY> <DstX> <SizeY> <SizeX>) in first bitstream buffer." << std::endl;
365  std::cout << std::endl;
366  std::cout << " Examples:" << std::endl;
367  std::cout << " # Copies second bitstream into first bitstream's buffer:" << std::endl;
368  std::cout << " " EXECUTABLE " XUSP -input bit1.bit -input second bit2.bin -merge full" << std::endl;
369  std::cout << std::endl;
370  std::cout << " # A rect in second buffer (Y from 50 to 99 and X from 10 to 29) is bitwise XORed in the clock and blockram" << std::endl;
371  std::cout << " # contents planes into a rect in 1st buffer describing Y from 100 to 149 and X from 30 to 49:" << std::endl;
372  std::cout << " " EXECUTABLE " Xilinx Series 7 -... -merge clock, bram, xor 50:10 50:20 100:30" << std::endl;
373  std::cout << std::endl;
374  std::cout << " # Copies the logic plane from buffer 2 into buffer 1:" << std::endl;
375  std::cout << " " EXECUTABLE " Xilinx US -... -m full, logic" << std::endl;
376  std::cout << std::endl;
377  std::cout << std::endl;
378 }

References EXECUTABLE.

Referenced by help().

Here is the caller graph for this function:

◆ helpOutput()

void byteman::helpOutput ( bool  selectedAll = false)

Definition at line 379 of file help.cpp.

380 {
381  if(selectedAll)
382  std::cout << "byteman: Output" << std::endl;
383  std::cout << " creates a bitstream file output from the first bitstream buffer in byteman." << std::endl;
384  std::cout << std::endl;
385  std::cout << " Usage:" << std::endl;
386  std::cout << " " EXECUTABLE " -output [Logic] [BlockRAM] [Blank] [Full, <StartY> <StartX> <SizeY> <SizeX>] <OutputFileName>" << std::endl;
387  std::cout << std::endl;
388  std::cout << " Args:" << std::endl;
389  std::cout << " [Logic]: selects the logic plane (incl global clock) of the bitstream. Enabled by default if no plane is explicitly specified." << std::endl;
390  std::cout << " [BlockRAM]: selects the BlockRAM contents plane of the bitstream. Enabled by default if no plane is explicitly specified." << std::endl;
391  std::cout << " [Blank]: blanks the selected regions to zeroes before writing the actual bitstream to them." << std::endl;
392  std::cout << " [Full]: selects all frames in the chip." << std::endl;
393  std::cout << " [<StartY> <StartX> <SizeY> <SizeX>]: selects a rect (<StartY> <StartX> <SizeY> <SizeX>) for output." << std::endl;
394  std::cout << " : also the list of selected regions will be output (see \"byteman -help Region\")." << std::endl;
395  std::cout << " <OutputFileName>: name of the output file. supports \".bit\" and \".bin\" file formats." << std::endl;
396  std::cout << std::endl;
397  std::cout << " Examples:" << std::endl;
398  std::cout << " # Output only the blockram contents to the whole FPGA:" << std::endl;
399  std::cout << " " EXECUTABLE " XUSP -input bitstream.bit -... -output bram, full bitfil.bit" << std::endl;
400  std::cout << std::endl;
401  std::cout << " # The rectangle describing Y from 50 to 99 and X from 10 to 29 is zeroed and then the logic plane bitstream data is written:" << std::endl;
402  std::cout << " " EXECUTABLE " Xilinx Series 7 -... -o logic, blank 50:10 50:20 bitstream.bin" << std::endl;
403  std::cout << std::endl;
404  std::cout << " # The rectangles (60:10 120:20 and 180:30 240:40) are zeroed and the logic & blockram content planes are written:" << std::endl;
405  std::cout << " " EXECUTABLE " XUS -... -r add 60:10 120:20 -o blank 180:30 240:40 fo.bit" << std::endl;
406  std::cout << std::endl;
407  std::cout << std::endl;
408 }

References EXECUTABLE.

Referenced by help().

Here is the caller graph for this function:

◆ helpRegion()

void byteman::helpRegion ( bool  selectedAll = false)

Definition at line 170 of file help.cpp.

171 {
172  if(selectedAll)
173  std::cout << "byteman: Region" << std::endl;
174  std::cout << " modifies the list of selected regions." << std::endl;
175  std::cout << std::endl;
176  std::cout << " Usage:" << std::endl;
177  std::cout << " " EXECUTABLE " -region [Clear, Add <SrcY> <SrcX> <SizeY> <SizeX>]" << std::endl;
178  std::cout << std::endl;
179  std::cout << " Args:" << std::endl;
180  std::cout << " [Clear]: clears the selected regions list." << std::endl;
181  std::cout << " [Add]: adds a new rect (<SrcY>:<SrcX> <SizeY>:<SizeX>) in the selected regions list." << std::endl;
182  std::cout << std::endl;
183  std::cout << " Examples:" << std::endl;
184  std::cout << " # Clears the list:" << std::endl;
185  std::cout << " " EXECUTABLE " XUSP -region clear" << std::endl;
186  std::cout << std::endl;
187  std::cout << " # Adds a rectangle describing Y from 100 to 149 and X from 7 to 21.:" << std::endl;
188  std::cout << " " EXECUTABLE " Xilinx Series 7 -r add 100:7 50:15" << std::endl;
189  std::cout << std::endl;
190  std::cout << " # Adds a rectangle describing Y from 120 to 179 and X from 7 to 21:" << std::endl;
191  std::cout << " " EXECUTABLE " Xilinx US -r add 120:7 60:15." << std::endl;
192  std::cout << std::endl;
193  std::cout << std::endl;
194 }

References EXECUTABLE.

Referenced by help().

Here is the caller graph for this function:

◆ helpStdin()

void byteman::helpStdin ( bool  selectedAll = false)

Definition at line 448 of file help.cpp.

449 {
450  if(selectedAll)
451  std::cout << "byteman: STDin" << std::endl;
452  std::cout << " continues reading commands from standard input rather than command line arguments. this way commands can be entered by hand or streamed in by another program or file." << std::endl;
453  std::cout << std::endl;
454  std::cout << " Usage:" << std::endl;
455  std::cout << " " EXECUTABLE " [commands]* -stdin" << std::endl;
456  std::cout << std::endl;
457  std::cout << " the input supports the following format rules:" << std::endl;
458  std::cout << " all commands are the same as their command line argument counterparts." << std::endl;
459  std::cout << " one command (with its arguments) per line." << std::endl;
460  std::cout << " '-' at the beginning of a command can be skipped." << std::endl;
461  std::cout << " '#' starts a comments until a new line is seen." << std::endl;
462  std::cout << " the command Exit will end reading the input stream and close byteman." << std::endl;
463  std::cout << std::endl;
464  std::cout << std::endl;
465 }

References EXECUTABLE.

Referenced by help().

Here is the caller graph for this function:

◆ helpVerbose()

void byteman::helpVerbose ( bool  selectedAll = false)

Definition at line 122 of file help.cpp.

123 {
124  if(selectedAll)
125  std::cout << "byteman: Verbose" << std::endl;
126  std::cout << " enables/disables logging messages. they are disabled by default." << std::endl;
127  std::cout << std::endl;
128  std::cout << " Usage:" << std::endl;
129  std::cout << " " EXECUTABLE " -verbose [<VerboseValue>]" << std::endl;
130  std::cout << std::endl;
131  std::cout << " Arg:" << std::endl;
132  std::cout << " [<VerboseValue>]: accepted values are 0 to disable and 1 to enable. Default is 1." << std::endl;
133  std::cout << std::endl;
134  std::cout << " Examples:" << std::endl;
135  std::cout << " # Enable logging:" << std::endl;
136  std::cout << " " EXECUTABLE " XUSP -v" << std::endl;
137  std::cout << std::endl;
138  std::cout << " # Disable logging, but it was disabled by default anyway:" << std::endl;
139  std::cout << " " EXECUTABLE " Xilinx US -verbose 0" << std::endl;
140  std::cout << std::endl;
141  std::cout << " # Enable logging for (-...) and then disable logging again:" << std::endl;
142  std::cout << " " EXECUTABLE " Xilinx Series 7 -v -... -v=0" << std::endl;
143  std::cout << std::endl;
144  std::cout << std::endl;
145 }

References EXECUTABLE.

Referenced by help().

Here is the caller graph for this function:

◆ helpWarn()

void byteman::helpWarn ( bool  selectedAll = false)

Definition at line 146 of file help.cpp.

147 {
148  if(selectedAll)
149  std::cout << "byteman: Warn" << std::endl;
150  std::cout << " enables/disables warning messages. they are enabled by default." << std::endl;
151  std::cout << std::endl;
152  std::cout << " Usage:" << std::endl;
153  std::cout << " " EXECUTABLE " -warn [<WarnValue>]" << std::endl;
154  std::cout << std::endl;
155  std::cout << " Arg:" << std::endl;
156  std::cout << " [<WarnValue>]: accepted values are 0 to disable and 1 to enable. Default is 1." << std::endl;
157  std::cout << std::endl;
158  std::cout << " Examples:" << std::endl;
159  std::cout << " # Enable warnings, but they were enabled by default anyway:" << std::endl;
160  std::cout << " " EXECUTABLE " XUSP -w" << std::endl;
161  std::cout << std::endl;
162  std::cout << " # Disable warnings:" << std::endl;
163  std::cout << " " EXECUTABLE " Xilinx US -warn 0" << std::endl;
164  std::cout << std::endl;
165  std::cout << " # Disable warnings for (-...) and then enable warnings again:" << std::endl;
166  std::cout << " " EXECUTABLE " Xilinx Series 7 -w=0 -... -w" << std::endl;
167  std::cout << std::endl;
168  std::cout << std::endl;
169 }

References EXECUTABLE.

Referenced by help().

Here is the caller graph for this function:

◆ parse()

void byteman::parse ( std::string  )

Definition at line 96 of file byteman.cpp.

97 {
98  command = str::replace(command, '=',' ');
99  command = str::replace(command, ':',' ');
100  if (command.at(0) == '-') command.erase(0, 1);
101  string params = str::findStringAndGetAllAfter(command, " ");
102  command = str::stringToLower(command);
103 
104  if(str::iff::firstStringWordIs(command, "h", "help"))//check if help first
105  help(params, 0);
106  else if(Architecture::Unknown == selectedArchitecture) //then check if architecture
107  setArchitecture(command);
108  else if(str::iff::firstStringWordIs(command, "v", "verbose")) //check the rest of commands
109  parseVerbose(params);
110  else if(str::iff::firstStringWordIs(command, "w", "warn"))
111  parseWarn(params);
112  else if(str::iff::firstStringWordIs(command, "r", "region"))
113  parseRegion(params);
114  else if(str::iff::firstStringWordIs(command, "b", "blank"))
115  parseBlank(params);
116  else if(str::iff::firstStringWordIs(command, "c", "change"))
117  parseChange(params);
118  else if(str::iff::firstStringWordIs(command, "d", "device"))
119  parseDevice(params);
120  else if(str::iff::firstStringWordIs(command, "i", "input"))
121  parseInput(params);
122  else if(str::iff::firstStringWordIs(command, "m", "merge"))
123  parseMerge(params);
124  else if(str::iff::firstStringWordIs(command, "o", "output"))
125  parseOutput(params);
126  else if(str::iff::firstStringWordIs(command, "a", "assembly"))
127  parseAssembly(params);
128  #if !defined(NDEBUG)
129  else if(str::iff::firstStringWordIs(command, "t", "test"))
130  parseTest(params);
131  #endif
132  else if(str::iff::firstStringWordIs(command, "e", "exit"))
133  exit(0);
134  else
135  throw runtime_error("Could not parse command. Consider checking out \"bytemap -help\".");
136 }
void parseAssembly(std::string)
Definition: byteman.cpp:398
void setArchitecture(std::string)
Definition: byteman.cpp:445
void parseVerbose(std::string)
Definition: byteman.cpp:169
void parseBlank(std::string)
Definition: byteman.cpp:241
void parseMerge(std::string)
Definition: byteman.cpp:376
void parseRegion(std::string)
Definition: byteman.cpp:217
void parseOutput(std::string)
Definition: byteman.cpp:354
void parseTest(std::string)
Definition: byteman.cpp:416
void parseInput(std::string)
Definition: byteman.cpp:325
void parseDevice(std::string)
Definition: byteman.cpp:297
void parseChange(std::string)
Definition: byteman.cpp:269
void parseWarn(std::string)
Definition: byteman.cpp:193
bool firstStringWordIs(std::string checkedString, std::string nextString, Rest ... restStrings)
Returns true if string checkedString's first word matches fully any of strings nextString or restStri...
Definition: iff.h:93
std::string stringToLower(std::string str)
Replaces all uppercase characters in str with lowercase and returns the resulting string.
Definition: str.h:59
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
std::string findStringAndGetAllAfter(std::string checkedString, std::string searchString)
Finds string searchString inside checkedString and returns all to the right inside checkedString....
Definition: str.h:33

References str::findStringAndGetAllAfter(), str::iff::firstStringWordIs(), str::replace(), and str::stringToLower().

Referenced by main().

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

◆ parseAssembly()

void byteman::parseAssembly ( std::string  )

Definition at line 398 of file byteman.cpp.

399 {
400  string filenameIn = str::parse::nthStringWord(assemblyCmd, 0);
401  string filenameOut = str::parse::nthStringWord(assemblyCmd, 1);
402  #ifdef XS7
404  mainXS7.assembler(filenameIn, filenameOut);
405  #endif
406  #ifdef XUS
408  mainXUS.assembler(filenameIn, filenameOut);
409  #endif
410  #ifdef XUSP
412  mainXUSP.assembler(filenameIn, filenameOut);
413  #endif
414 }
std::string nthStringWord(std::string s, int n)
Parses a string s, returns the n-th string word that is not an integer.
Definition: parse.h:33

References str::parse::nthStringWord().

Here is the call graph for this function:

◆ parseBlank()

void byteman::parseBlank ( std::string  )

Definition at line 241 of file byteman.cpp.

242 {
243  string params = parseParamsAndRemoveThemFromString(blankCmd);
244  #ifdef XS7
247  mainXS7.blank(params);
249  tempXS7.blank(params);
250  }
251  #endif
252  #ifdef XUS
255  mainXUS.blank(params);
257  tempXUS.blank(params);
258  }
259  #endif
260  #ifdef XUSP
263  mainXUSP.blank(params);
265  tempXUSP.blank(params);
266  }
267  #endif
268 }
std::string parseParamsAndRemoveThemFromString(std::string)
Definition: byteman.cpp:146
struct byteman::SelectedOptions options

◆ parseChange()

void byteman::parseChange ( std::string  )

Definition at line 269 of file byteman.cpp.

270 {
271  string changeParams = parseParamsAndRemoveThemFromString(changeCmd);
272  #ifdef XS7
275  mainXS7.change(changeParams);
277  tempXS7.change(changeParams);
278  }
279  #endif
280  #ifdef XUS
283  mainXUS.change(changeParams);
285  tempXUS.change(changeParams);
286  }
287  #endif
288  #ifdef XUSP
291  mainXUSP.change(changeParams);
293  tempXUSP.change(changeParams);
294  }
295  #endif
296 }

◆ parseDevice()

void byteman::parseDevice ( std::string  )

Definition at line 297 of file byteman.cpp.

298 {
299  string deviceName = parseParamsAndRemoveThemFromString(deviceCmd);
300  #ifdef XS7
303  mainXS7.setDeviceByNameOrThrow(deviceName);
305  tempXS7.setDeviceByNameOrThrow(deviceName);
306  }
307  #endif
308  #ifdef XUS
311  mainXUS.setDeviceByNameOrThrow(deviceName);
313  tempXUS.setDeviceByNameOrThrow(deviceName);
314  }
315  #endif
316  #ifdef XUSP
319  mainXUSP.setDeviceByNameOrThrow(deviceName);
321  tempXUSP.setDeviceByNameOrThrow(deviceName);
322  }
323  #endif
324 }

◆ parseInput()

void byteman::parseInput ( std::string  )

Definition at line 325 of file byteman.cpp.

326 {
327  string params = parseParamsAndRemoveThemFromString(inputCmd);
328  string filename = str::parse::lastStringWord(params);
329  #ifdef XS7
332  mainXS7.readBitstream(filename);
334  tempXS7.readBitstream(filename);
335  }
336  #endif
337  #ifdef XUS
340  mainXUS.readBitstream(filename);
342  tempXUS.readBitstream(filename);
343  }
344  #endif
345  #ifdef XUSP
348  mainXUSP.readBitstream(filename);
350  tempXUSP.readBitstream(filename);
351  }
352  #endif
353 }
std::string lastStringWord(std::string s)
Parses a string s, removes all integers and returns the last of all string words.
Definition: parse.h:81

References str::parse::lastStringWord().

Here is the call graph for this function:

◆ parseMerge()

void byteman::parseMerge ( std::string  )

Definition at line 376 of file byteman.cpp.

377 {
378  string params = str::parse::allStringWords(mergeCmd);
379  Rect2D rect;
380  Coord2D dst;
381  str::parse::multipleInts(mergeCmd, rect.position.row, rect.position.col, rect.size.row, rect.size.col, dst.row, dst.col);
382  #ifdef XS7
384  mainXS7.merge(&tempXS7, params, rect, dst);
385  }
386  #endif
387  #ifdef XUS
389  mainXUS.merge(&tempXUS, params, rect, dst);
390  }
391  #endif
392  #ifdef XUSP
394  mainXUSP.merge(&tempXUSP, params, rect, dst);
395  }
396  #endif
397 }
Definition: Coords.h:33
std::string allStringWords(std::string s)
Parses a string s, removes all integers and returns the rest.
Definition: parse.h:57
bool multipleInts(std::stringstream &ss)
Definition: parse.h:192
Definition: Coords.h:23
int col
Definition: Coords.h:25
int row
Definition: Coords.h:24
Definition: Coords.h:29

References str::parse::allStringWords(), Coord2D::col, str::parse::multipleInts(), and Coord2D::row.

Here is the call graph for this function:

◆ parseOutput()

void byteman::parseOutput ( std::string  )

Definition at line 354 of file byteman.cpp.

355 {
356  string params = str::parse::allStringWordsWithoutLastStringWord(outputCmd);
357  string filename = str::parse::lastStringWord(outputCmd);
358  Rect2D rect;
359  str::parse::multipleInts(outputCmd, rect.position.row, rect.position.col, rect.size.row, rect.size.col);
360  #ifdef XS7
362  mainXS7.writeBitstream(filename, params, rect);
363  }
364  #endif
365  #ifdef XUS
367  mainXUS.writeBitstream(filename, params, rect);
368  }
369  #endif
370  #ifdef XUSP
372  mainXUSP.writeBitstream(filename, params, rect);
373  }
374  #endif
375 }
std::string allStringWordsWithoutLastStringWord(std::string s)
Parses a string s, removes all integers and the last string word. Returns the rest.
Definition: parse.h:105

References str::parse::allStringWordsWithoutLastStringWord(), str::parse::lastStringWord(), and str::parse::multipleInts().

Here is the call graph for this function:

◆ parseParamsAndRemoveThemFromString()

string byteman::parseParamsAndRemoveThemFromString ( std::string  )

Parses argument options for byteman

  • params A list of parameters to control behavior:
    • "main" or "first" : Selects the main bitstream buffer as target for the operation
    • "temp" or "second" : Selects the temp bitstream buffer as target for the operation
      Returns
      the string without the valid parameters

Definition at line 146 of file byteman.cpp.

147 {
148  string commandWithoutTheValidParams = "";
149  options = SelectedOptions();
150  params = str::replace(params, ',', ' ');
151  stringstream ss(params);
152  string param;
153  while (!ss.eof()) {
154  ss >> param;
155  if("main" == param || "first" == param)options.mainBufferSelected = true;
156  else if("temp" == param || "second" == param)options.tempBufferSelected = true;
157  else {
158  if(commandWithoutTheValidParams != "")
159  commandWithoutTheValidParams.append(" ");
160  commandWithoutTheValidParams.append(param);
161  }
162  param.clear();
163  }
164  if(!options.mainBufferSelected && !options.tempBufferSelected) // by default, choose the main buffer
166  return commandWithoutTheValidParams;
167 }

References str::replace().

Here is the call graph for this function:

◆ parseRegion()

void byteman::parseRegion ( std::string  )

Definition at line 217 of file byteman.cpp.

218 {
219  string params = str::parse::allStringWords(regionCmd);
220  Rect2D rect;
221  str::parse::multipleInts(regionCmd, rect.position.row, rect.position.col, rect.size.row, rect.size.col);
222  #ifdef XS7
224  mainXS7.region(params, rect);
225  tempXS7.region(params, rect);
226  }
227  #endif
228  #ifdef XUS
230  mainXUS.region(params, rect);
231  tempXUS.region(params, rect);
232  }
233  #endif
234  #ifdef XUSP
236  mainXUSP.region(params, rect);
237  tempXUSP.region(params, rect);
238  }
239  #endif
240 }

References str::parse::allStringWords(), and str::parse::multipleInts().

Here is the call graph for this function:

◆ parseTest()

void byteman::parseTest ( std::string  )

Definition at line 416 of file byteman.cpp.

417 {
418  uint32_t testValue;
419  if(!str::parse::multipleUints(testCmd, testValue))
420  testValue = 0;
421 
422  testCmd = str::stringToLower(testCmd);
423  bool usableFramesOnly = false;
424  if(str::iff::stringContains(testCmd, "usableframes", "mappedframes"))
425  usableFramesOnly = true;
426 
427  bool testValueEqual = true;
428  if(str::iff::stringContains(testCmd, "notequal"))
429  testValueEqual = false;
430  #ifdef XS7
432  mainXS7.test(usableFramesOnly, testValueEqual, testValue);
433  #endif
434  #ifdef XUS
436  mainXUS.test(usableFramesOnly, testValueEqual, testValue);
437  #endif
438  #ifdef XUSP
440  mainXUSP.test(usableFramesOnly, testValueEqual, testValue);
441  #endif
442 }
bool stringContains(std::string checkedString)
Returns false. End of recursion for template.
Definition: iff.h:57
bool multipleUints(std::stringstream &ss)
Definition: parse.h:229

References str::parse::multipleUints(), str::iff::stringContains(), and str::stringToLower().

Here is the call graph for this function:

◆ parseVerbose()

void byteman::parseVerbose ( std::string  )

Definition at line 169 of file byteman.cpp.

170 {
171  int verboseValue;
172  if(!str::parse::multipleInts(verboseCmd, verboseValue))verboseValue = 1; // if nothing was given, default to 1
173 
174  #ifdef XS7
176  mainXS7.enableLog = verboseValue;
177  tempXS7.enableLog = verboseValue;
178  }
179  #endif
180  #ifdef XUS
182  mainXUS.enableLog = verboseValue;
183  tempXUS.enableLog = verboseValue;
184  }
185  #endif
186  #ifdef XUSP
188  mainXUSP.enableLog = verboseValue;
189  tempXUSP.enableLog = verboseValue;
190  }
191  #endif
192 }

References str::parse::multipleInts().

Here is the call graph for this function:

◆ parseWarn()

void byteman::parseWarn ( std::string  )

Definition at line 193 of file byteman.cpp.

194 {
195  int warnValue;
196  if(!str::parse::multipleInts(warnCmd, warnValue))warnValue = 1; // if nothing was given, default to 1
197 
198  #ifdef XS7
200  mainXS7.enableWarn = warnValue;
201  tempXS7.enableWarn = warnValue;
202  }
203  #endif
204  #ifdef XUS
206  mainXUS.enableWarn = warnValue;
207  tempXUS.enableWarn = warnValue;
208  }
209  #endif
210  #ifdef XUSP
212  mainXUSP.enableWarn = warnValue;
213  tempXUSP.enableWarn = warnValue;
214  }
215  #endif
216 }

References str::parse::multipleInts().

Here is the call graph for this function:

◆ setArchitecture()

void byteman::setArchitecture ( std::string  )

Definition at line 445 of file byteman.cpp.

446 {
447  arch = str::stringToLower(arch);
448  #ifdef XUSP
449  if(str::iff::stringContains(arch, "xusp")
450  || ( str::iff::stringContains(arch, "xilinx")
451  && str::iff::stringContains(arch, "ultrascale", "us")
452  && str::iff::stringContains(arch, "plus", "+")
453  )
454  ) {
456  return;
457  }
458  #endif//XUSP
459  #ifdef XUS
460  if(str::iff::stringContains(arch, "xus")
461  || ( str::iff::stringContains(arch, "xilinx")
462  && str::iff::stringContains(arch, "ultrascale", "us")
463  )
464  ) {
466  return;
467  }
468  #endif//XUS
469  #ifdef XS7
470  if(str::iff::stringContains(arch, "xs7")
471  || ( str::iff::stringContains(arch, "xilinx")
472  && str::iff::stringContains(arch, "series")
473  && str::iff::stringContains(arch, "7")
474  )
475  ) {
477  return;
478  }
479  #endif//XS7
480  throw runtime_error(string("Unknown architecture: \"").append(arch).append("\"."));
481 }

References str::iff::stringContains(), and str::stringToLower().

Here is the call graph for this function:

Member Data Documentation

◆ options

struct byteman::SelectedOptions byteman::options

◆ selectedArchitecture

enum byteman::Architecture byteman::selectedArchitecture = Architecture::Unknown

Referenced by helpDevice().


The documentation for this class was generated from the following files: