Interactive Mode¶
Interactive Mode enable user to communicate with tool interactively, one command by one command. User can explore tool internal data and state through this mode.
To enter Interactive Mode, run:
$> qk regfab -i
After entering Interactive Mode, to see which commands are supported, run help or ?:
RegFab:> ?
RegFab:> help
Supported Commands¶
- load
Command
loadis used to load in design file, i.e. .XML file or Excel file.:RegFab:> load -h usage: load [-h] [-t TYPE] filename positional arguments: filename File to load optional arguments: -h, --help show this help message and exit -t TYPE, --type TYPE Input file type
If file extension can’t indicate file type, use switch
-t TYPEto specify it.:RegFab:> load a.xml RegFab:> load a.xlsx RegFab:> load -t xml a.txt RegFab:> load -t excel a.xlm
- save
Command
saveis used to save design data to a file, i.e. .XML file or Excel file.:RegFab:> save -h usage: save [-h] [-t TYPE] filename positional arguments: filename File to load optional arguments: -h, --help show this help message and exit -t TYPE, --type TYPE Input file type
If file extension can’t indicate file type, use switch
-t TYPEto specify it.:RegFab:> save a.xml RegFab:> save a.xlsx RegFab:> save -t xml a.txt
- source
Command
sourceis used to read in another command file.:RegFab:> source -h usage: source [-h] cmdfile positional arguments: cmdfile Command file optional arguments: -h, --help show this help message and exit
- baseaddress
Command
baseaddressis used to get or set component base-address.:RegFab:> baseaddress -h usage: baseaddress [-h] [baseaddress] positional arguments: baseaddress BaseAddress to set optional arguments: -h, --help show this help message and exit
To get current base-address, run:
RegFab:> baseaddress
To set base-address, run:
RegFab:> baseaddress 0x40000
- find
Command
findis used to search registers or register bits.:RegFab:> find -h usage: find [-h] [-re] [-x] [name [name ...]] positional arguments: name Object name to find optional arguments: -h, --help show this help message and exit -re Using Regular-Expression -x Expand Loop register or bits
Argument
namehas a form of:[group:]register[.bit], group is for data model RegSet, register is for data model Register, bit is for data model BitField.All of three parts of name can use Linux glob pattern, or Regular-Expression pattern with switch
-re.Example1: Find all RegSets whose name contains ab:
RegFab:> find *ab*:
Example2: Find all registers whose name starts with b:
RegFab:> find b*
Example3: Find all registers in RegSet abc:
RegFab:> find abc:*
Example4: Find all BitFields of registers, register’s name contains clk:
RegFab:> find *clk*.*
Example5: Find all registers whose name match a regular-expression:
RegFab:> find -re a\d+.*
Example6: Find all BitFields whose name contains abc:
RegFab:> find .*abc*
Example7: Find all BitFields whose name match a regular-expression:
RegFab:> find -re \.a\d+.*
- tree
Command
treeis used to print out the hierarchy of some Registers.:RegFab:> tree -h usage: tree [-h] [-re] [name [name ...]] positional arguments: name Register name pattern optional arguments: -h, --help show this help message and exit -re Using Regular-Expression
Argument
nameis for register name, can use Linux glob pattern, or Regular-Expression pattern when with switch-re.:RegFab:> tree RegFab:> tree *abc* RegFab:> tree -re a\d+.*
- hide
Command
hideis used to make some registers or bit-fields hidden, and not visible for code generation.:RegFab:> hide -h usage: hide [-h] [-re] [names [names ...]] positional arguments: names Object names (format: [group:]register[.bit]) to hide optional arguments: -h, --help show this help message and exit -re Using Regular-Expression
Argument
namehas same meaning with commandfind.- unhide
Command
unhideis used to make hidden registers or bit-fields visible again.:RegFab:> unhide -h usage: unhide [-h] [-re] [names [names ...]] positional arguments: names Object names (format: [group:]register[.bit]) to hide optional arguments: -h, --help show this help message and exit -re Using Regular-Expression
Argument
namehas same meaning with commandfind.- change
Command
changeis used to change internal object’s property value.:RegFab:> change -h usage: change [-h] attr value positional arguments: attr Object attribute to be changed value Changed value optional arguments: -h, --help show this help message and exit
- generate
Command
generateis used to generate output based on template.:RegFab:> generate -h usage: generate [-h] [-t TEMPLATE] [-o OUTPUT] optional arguments: -h, --help show this help message and exit -t TEMPLATE, --template TEMPLATE Template used to generate -o OUTPUT, --output OUTPUT Save output to file
- summary
Command
summaryis used to print out overview of internal data.:RegFab:> summary ================================================================================ = S U M M A R Y ================================================================================ Components: Parameters: 0 Constants : 0 Generics : 0 Interfaces: 0 Registers : 0
Batch Mode¶
Batch Mode is similar with Interactive Mode, the difference is that user put all commands in a file, and run them in sequence, and exit after all commands finish.
For command file, below are the rules:
One command per line
Blank lines and comment lines are ignored
Comment starts with ‘#’ and till end of the line
After user prepared a command file, then run:
$> qk regfab -f a.cmd