% Generated using the yosys 'help -write-tex-command-reference-manual' command. \section{abc -- use ABC for technology mapping} \label{cmd:abc} \begin{lstlisting}[numbers=left,frame=single] abc [options] [selection] This pass uses the ABC tool [1] for technology mapping of yosys's internal gate library to a target architecture. -exe use the specified command name instead of "yosys-abc" to execute ABC. This can e.g. be used to call a specific version of ABC or a wrapper. -script use the specified ABC script file instead of the default script. if starts with a plus sign (+), then the rest of the filename string is interpreted as the command string to be passed to ABC. The leading plus sign is removed and all commas (,) in the string are replaced with blanks before the string is passed to ABC. if no -script parameter is given, the following scripts are used: for -liberty without -constr: strash; scorr; ifraig; retime {D}; strash; dch -f; map {D} for -liberty with -constr: strash; scorr; ifraig; retime {D}; strash; dch -f; map {D}; buffer; upsize {D}; dnsize {D}; stime -p for -lut: strash; scorr; ifraig; retime; strash; dch -f; if otherwise: strash; scorr; ifraig; retime; strash; dch -f; map -fast use different default scripts that are slightly faster (at the cost of output quality): for -liberty without -constr: retime {D}; map {D} for -liberty with -constr: retime {D}; map {D}; buffer; upsize {D}; dnsize {D}; stime -p for -lut: retime; if otherwise: retime; map -liberty generate netlists for the specified cell library (using the liberty file format). -constr pass this file with timing constraints to ABC. use with -liberty. a constr file contains two lines: set_driving_cell set_load the set_driving_cell statement defines which cell type is assumed to drive the primary inputs and the set_load statement sets the load in femtofarads for each primary output. -D set delay target. the string {D} in the default scripts above is replaced by this option when used, and an empty string otherwise. -lut generate netlist using luts of (max) the specified width. -lut : generate netlist using luts of (max) the specified width . All luts with width <= have constant cost. for luts larger than the area cost doubles with each additional input bit. the delay cost is still constant for all lut widths. -dff also pass $_DFF_?_ and $_DFFE_??_ cells through ABC. modules with many clock domains are automatically partitioned in clock domains and each domain is passed through ABC independently. -clk [!][,[!]] use only the specified clock domain. this is like -dff, but only FF cells that belong to the specified clock domain are used. -keepff set the "keep" attribute on flip-flop output wires. (and thus preserve them, for example for equivalence checking.) -nocleanup when this option is used, the temporary files created by this pass are not removed. this is useful for debugging. -showtmp print the temp dir name in log. usually this is suppressed so that the command output is identical across runs. -markgroups set a 'abcgroup' attribute on all objects created by ABC. The value of this attribute is a unique integer for each ABC process started. This is useful for debugging the partitioning of clock domains. When neither -liberty nor -lut is used, the Yosys standard cell library is loaded into ABC before the ABC script is executed. This pass does not operate on modules with unprocessed processes in it. (I.e. the 'proc' pass should be used first to convert processes to netlists.) [1] http://www.eecs.berkeley.edu/~alanmi/abc/ \end{lstlisting} \section{add -- add objects to the design} \label{cmd:add} \begin{lstlisting}[numbers=left,frame=single] add [selection] This command adds objects to the design. It operates on all fully selected modules. So e.g. 'add -wire foo' will add a wire foo to all selected modules. add {-wire|-input|-inout|-output} [selection] Add a wire (input, inout, output port) with the given name and width. The command will fail if the object exists already and has different properties than the object to be created. add -global_input [selection] Like 'add -input', but also connect the signal between instances of the selected modules. \end{lstlisting} \section{alumacc -- extract ALU and MACC cells} \label{cmd:alumacc} \begin{lstlisting}[numbers=left,frame=single] alumacc [selection] This pass translates arithmetic operations like $add, $mul, $lt, etc. to $alu and $macc cells. \end{lstlisting} \section{cd -- a shortcut for 'select -module '} \label{cmd:cd} \begin{lstlisting}[numbers=left,frame=single] cd This is just a shortcut for 'select -module '. cd When no module with the specified name is found, but there is a cell with the specified name in the current module, then this is equivalent to 'cd '. cd .. This is just a shortcut for 'select -clear'. \end{lstlisting} \section{clean -- remove unused cells and wires} \label{cmd:clean} \begin{lstlisting}[numbers=left,frame=single] clean [options] [selection] This is identical to 'opt_clean', but less verbose. When commands are separated using the ';;' token, this command will be executed between the commands. When commands are separated using the ';;;' token, this command will be executed in -purge mode between the commands. \end{lstlisting} \section{connect -- create or remove connections} \label{cmd:connect} \begin{lstlisting}[numbers=left,frame=single] connect [-nomap] [-nounset] -set Create a connection. This is equivalent to adding the statement 'assign = ;' to the Verilog input. Per default, all existing drivers for are unconnected. This can be overwritten by using the -nounset option. connect [-nomap] -unset Unconnect all existing drivers for the specified expression. connect [-nomap] -port Connect the specified cell port to the specified cell port. Per default signal alias names are resolved and all signal names are mapped the the signal name of the primary driver. Using the -nomap option deactivates this behavior. The connect command operates in one module only. Either only one module must be selected or an active module must be set using the 'cd' command. This command does not operate on module with processes. \end{lstlisting} \section{connwrappers -- replace undef values with defined constants} \label{cmd:connwrappers} \begin{lstlisting}[numbers=left,frame=single] connwrappers [options] [selection] Wrappers are used in coarse-grain synthesis to wrap cells with smaller ports in wrapper cells with a (larger) constant port size. I.e. the upper bits of the wrapper output are signed/unsigned bit extended. This command uses this knowledge to rewire the inputs of the driven cells to match the output of the driving cell. -signed -unsigned consider the specified signed/unsigned wrapper output -port use the specified parameter to decide if signed or unsigned The options -signed, -unsigned, and -port can be specified multiple times. \end{lstlisting} \section{copy -- copy modules in the design} \label{cmd:copy} \begin{lstlisting}[numbers=left,frame=single] copy old_name new_name Copy the specified module. Note that selection patterns are not supported by this command. \end{lstlisting} \section{cover -- print code coverage counters} \label{cmd:cover} \begin{lstlisting}[numbers=left,frame=single] cover [options] [pattern] Print the code coverage counters collected using the cover() macro in the Yosys C++ code. This is useful to figure out what parts of Yosys are utilized by a test bench. -q Do not print output to the normal destination (console and/or log file) -o file Write output to this file, truncate if exists. -a file Write output to this file, append if exists. -d dir Write output to a newly created file in the specified directory. When one or more pattern (shell wildcards) are specified, then only counters matching at least one pattern are printed. It is also possible to instruct Yosys to print the coverage counters on program exit to a file using environment variables: YOSYS_COVER_DIR="{dir-name}" yosys {args} This will create a file (with an auto-generated name) in this directory and write the coverage counters to it. YOSYS_COVER_FILE="{file-name}" yosys {args} This will append the coverage counters to the specified file. Hint: Use the following AWK command to consolidate Yosys coverage files: gawk '{ p[$3] = $1; c[$3] += $2; } END { for (i in p) printf "%-60s %10d %s\n", p[i], c[i], i; }' {files} | sort -k3 Coverage counters are only available in Yosys for Linux. \end{lstlisting} \section{delete -- delete objects in the design} \label{cmd:delete} \begin{lstlisting}[numbers=left,frame=single] delete [selection] Deletes the selected objects. This will also remove entire modules, if the whole module is selected. delete {-input|-output|-port} [selection] Does not delete any object but removes the input and/or output flag on the selected wires, thus 'deleting' module ports. \end{lstlisting} \section{design -- save, restore and reset current design} \label{cmd:design} \begin{lstlisting}[numbers=left,frame=single] design -reset Clear the current design. design -save Save the current design under the given name. design -stash Save the current design under the given name and then clear the current design. design -push Push the current design to the stack and then clear the current design. design -pop Reset the current design and pop the last design from the stack. design -load Reset the current design and load the design previously saved under the given name. design -copy-from [-as ] Copy modules from the specified design into the current one. The selection is evaluated in the other design. design -copy-to [-as ] [selection] Copy modules from the current design into the specified one. \end{lstlisting} \section{dff2dffe -- transform \$dff cells to \$dffe cells} \label{cmd:dff2dffe} \begin{lstlisting}[numbers=left,frame=single] dff2dffe [selection] This pass transforms $dff cells driven by a tree of multiplexers with one or more feedback paths to $dffe cells. It also works on gate-level cells such as $_DFF_P_, $_DFF_N_ and $_MUX_. -unmap operate in the opposite direction: replace $dffe cells with combinations of $dff and $mux cells. the options below are ignore in unmap mode. -direct map directly to external gate type. can be any internal gate-level FF cell (except $_DFFE_??_). the is the cell type name for a cell with an identical interface to the , except it also has an high-active enable port 'E'. Usually is an intermediate cell type that is then translated to the final type using 'techmap'. \end{lstlisting} \section{dfflibmap -- technology mapping of flip-flops} \label{cmd:dfflibmap} \begin{lstlisting}[numbers=left,frame=single] dfflibmap [-prepare] -liberty [selection] Map internal flip-flop cells to the flip-flop cells in the technology library specified in the given liberty file. This pass may add inverters as needed. Therefore it is recommended to first run this pass and then map the logic paths to the target technology. When called with -prepare, this command will convert the internal FF cells to the internal cell types that best match the cells found in the given liberty file. \end{lstlisting} \section{dump -- print parts of the design in ilang format} \label{cmd:dump} \begin{lstlisting}[numbers=left,frame=single] dump [options] [selection] Write the selected parts of the design to the console or specified file in ilang format. -m also dump the module headers, even if only parts of a single module is selected -n only dump the module headers if the entire module is selected -o write to the specified file. -a like -outfile but append instead of overwrite \end{lstlisting} \section{echo -- turning echoing back of commands on and off} \label{cmd:echo} \begin{lstlisting}[numbers=left,frame=single] echo on Print all commands to log before executing them. echo off Do not print all commands to log before executing them. (default) \end{lstlisting} \section{equiv\_add -- add a \$equiv cell} \label{cmd:equiv_add} \begin{lstlisting}[numbers=left,frame=single] equiv_add gold_sig gate_sig This command adds an $equiv cell for the specified signals. \end{lstlisting} \section{equiv\_induct -- proving \$equiv cells using temporal induction} \label{cmd:equiv_induct} \begin{lstlisting}[numbers=left,frame=single] equiv_induct [options] [selection] Uses a version of temporal induction to prove $equiv cells. Only selected $equiv cells are proven and only selected cells are used to perform the proof. -undef enable modelling of undef states -seq the max. number of time steps to be considered (default = 4) This command is very effective in proving complex sequential circuits, when the internal state of the circuit quickly propagates to $equiv cells. However, this command uses a weak definition of 'equivalence': This command proves that the two circuits will not diverge after they produce equal outputs (observable points via $equiv) for at least cycles (the specified via -seq). Combined with simulation this is very powerful because simulation can give you confidence that the circuits start out synced for at least cycles after reset. \end{lstlisting} \section{equiv\_make -- prepare a circuit for equivalence checking} \label{cmd:equiv_make} \begin{lstlisting}[numbers=left,frame=single] equiv_make [options] gold_module gate_module equiv_module This creates a module annotated with $equiv cells from two presumably equivalent modules. Use commands such as 'equiv_simple' and 'equiv_status' to work with the created equivalent checking module. -inames Also match cells and wires with $... names. -blacklist Do not match cells or signals that match the names in the file. -encfile Match FSM encodings using the description from the file. See 'help fsm_recode' for details. Note: The circuit created by this command is not a miter (with something like a trigger output), but instead uses $equiv cells to encode the equivalence checking problem. Use 'miter -equiv' if you want to create a miter circuit. \end{lstlisting} \section{equiv\_miter -- extract miter from equiv circuit} \label{cmd:equiv_miter} \begin{lstlisting}[numbers=left,frame=single] equiv_miter [options] miter_module [selection] This creates a miter module for further analysis of the selected $equiv cells. -trigger Create a trigger output -cmp Create cmp_* outputs for individual unproven $equiv cells -assert Create a $assert cell for each unproven $equiv cell -undef Create compare logic that handles undefs correctly \end{lstlisting} \section{equiv\_remove -- remove \$equiv cells} \label{cmd:equiv_remove} \begin{lstlisting}[numbers=left,frame=single] equiv_remove [options] [selection] This command removes the selected $equiv cells. If neither -gold nor -gate is used then only proven cells are removed. -gold keep gold circuit -gate keep gate circuit \end{lstlisting} \section{equiv\_simple -- try proving simple \$equiv instances} \label{cmd:equiv_simple} \begin{lstlisting}[numbers=left,frame=single] equiv_simple [options] [selection] This command tries to prove $equiv cells using a simple direct SAT approach. -v verbose output -undef enable modelling of undef states -nogroup disabling grouping of $equiv cells by output wire -seq the max. number of time steps to be considered (default = 1) \end{lstlisting} \section{equiv\_status -- print status of equivalent checking module} \label{cmd:equiv_status} \begin{lstlisting}[numbers=left,frame=single] equiv_status [options] [selection] This command prints status information for all selected $equiv cells. -assert produce an error if any unproven $equiv cell is found \end{lstlisting} \section{eval -- evaluate the circuit given an input} \label{cmd:eval} \begin{lstlisting}[numbers=left,frame=single] eval [options] [selection] This command evaluates the value of a signal given the value of all required inputs. -set set the specified signal to the specified value. -set-undef set all unspecified source signals to undef (x) -table create a truth table using the specified input signals -show show the value for the specified signal. if no -show option is passed then all output ports of the current module are used. \end{lstlisting} \section{expose -- convert internal signals to module ports} \label{cmd:expose} \begin{lstlisting}[numbers=left,frame=single] expose [options] [selection] This command exposes all selected internal signals of a module as additional outputs. -dff only consider wires that are directly driven by register cell. -cut when exposing a wire, create an input/output pair and cut the internal signal path at that wire. -shared only expose those signals that are shared among the selected modules. this is useful for preparing modules for equivalence checking. -evert also turn connections to instances of other modules to additional inputs and outputs and remove the module instances. -evert-dff turn flip-flops to sets of inputs and outputs. -sep when creating new wire/port names, the original object name is suffixed with this separator (default: '.') and the port name or a type designator for the exposed signal. \end{lstlisting} \section{extract -- find subcircuits and replace them with cells} \label{cmd:extract} \begin{lstlisting}[numbers=left,frame=single] extract -map [options] [selection] extract -mine [options] [selection] This pass looks for subcircuits that are isomorphic to any of the modules in the given map file and replaces them with instances of this modules. The map file can be a Verilog source file (*.v) or an ilang file (*.il). -map use the modules in this file as reference. This option can be used multiple times. -map % use the modules in this in-memory design as reference. This option can be used multiple times. -verbose print debug output while analyzing -constports also find instances with constant drivers. this may be much slower than the normal operation. -nodefaultswaps normally builtin port swapping rules for internal cells are used per default. This turns that off, so e.g. 'a^b' does not match 'b^a' when this option is used. -compat Per default, the cells in the map file (needle) must have the type as the cells in the active design (haystack). This option can be used to register additional pairs of types that should match. This option can be used multiple times. -swap ,[,...] Register a set of swappable ports for a needle cell type. This option can be used multiple times. -perm ,[,...] ,[,...] Register a valid permutation of swappable ports for a needle cell type. This option can be used multiple times. -cell_attr Attributes on cells with the given name must match. -wire_attr Attributes on wires with the given name must match. -ignore_parameters Do not use parameters when matching cells. -ignore_param Do not use this parameter when matching cells. This pass does not operate on modules with unprocessed processes in it. (I.e. the 'proc' pass should be used first to convert processes to netlists.) This pass can also be used for mining for frequent subcircuits. In this mode the following options are to be used instead of the -map option. -mine mine for frequent subcircuits and write them to the given ilang file -mine_cells_span only mine for subcircuits with the specified number of cells default value: 3 5 -mine_min_freq only mine for subcircuits with at least the specified number of matches default value: 10 -mine_limit_matches_per_module when calculating the number of matches for a subcircuit, don't count more than the specified number of matches per module -mine_max_fanout don't consider internal signals with more than connections The modules in the map file may have the attribute 'extract_order' set to an integer value. Then this value is used to determine the order in which the pass tries to map the modules to the design (ascending, default value is 0). See 'help techmap' for a pass that does the opposite thing. \end{lstlisting} \section{flatten -- flatten design} \label{cmd:flatten} \begin{lstlisting}[numbers=left,frame=single] flatten [selection] This pass flattens the design by replacing cells by their implementation. This pass is very similar to the 'techmap' pass. The only difference is that this pass is using the current design as mapping library. \end{lstlisting} \section{freduce -- perform functional reduction} \label{cmd:freduce} \begin{lstlisting}[numbers=left,frame=single] freduce [options] [selection] This pass performs functional reduction in the circuit. I.e. if two nodes are equivalent, they are merged to one node and one of the redundant drivers is disconnected. A subsequent call to 'clean' will remove the redundant drivers. -v, -vv enable verbose or very verbose output -inv enable explicit handling of inverted signals -stop stop after reduction operations. this is mostly used for debugging the freduce command itself. -dump dump the design to __.il after each reduction operation. this is mostly used for debugging the freduce command. This pass is undef-aware, i.e. it considers don't-care values for detecting equivalent nodes. All selected wires are considered for rewiring. The selected cells cover the circuit that is analyzed. \end{lstlisting} \section{fsm -- extract and optimize finite state machines} \label{cmd:fsm} \begin{lstlisting}[numbers=left,frame=single] fsm [options] [selection] This pass calls all the other fsm_* passes in a useful order. This performs FSM extraction and optimization. It also calls opt_clean as needed: fsm_detect unless got option -nodetect fsm_extract fsm_opt opt_clean fsm_opt fsm_expand if got option -expand opt_clean if got option -expand fsm_opt if got option -expand fsm_recode unless got option -norecode fsm_info fsm_export if got option -export fsm_map unless got option -nomap Options: -expand, -norecode, -export, -nomap enable or disable passes as indicated above -encoding type -fm_set_fsm_file file -encfile file passed through to fsm_recode pass \end{lstlisting} \section{fsm\_detect -- finding FSMs in design} \label{cmd:fsm_detect} \begin{lstlisting}[numbers=left,frame=single] fsm_detect [selection] This pass detects finite state machines by identifying the state signal. The state signal is then marked by setting the attribute 'fsm_encoding' on the state signal to "auto". Existing 'fsm_encoding' attributes are not changed by this pass. Signals can be protected from being detected by this pass by setting the 'fsm_encoding' attribute to "none". \end{lstlisting} \section{fsm\_expand -- expand FSM cells by merging logic into it} \label{cmd:fsm_expand} \begin{lstlisting}[numbers=left,frame=single] fsm_expand [selection] The fsm_extract pass is conservative about the cells that belong to a finite state machine. This pass can be used to merge additional auxiliary gates into the finite state machine. \end{lstlisting} \section{fsm\_export -- exporting FSMs to KISS2 files} \label{cmd:fsm_export} \begin{lstlisting}[numbers=left,frame=single] fsm_export [-noauto] [-o filename] [-origenc] [selection] This pass creates a KISS2 file for every selected FSM. For FSMs with the 'fsm_export' attribute set, the attribute value is used as filename, otherwise the module and cell name is used as filename. If the parameter '-o' is given, the first exported FSM is written to the specified filename. This overwrites the setting as specified with the 'fsm_export' attribute. All other FSMs are exported to the default name as mentioned above. -noauto only export FSMs that have the 'fsm_export' attribute set -o filename filename of the first exported FSM -origenc use binary state encoding as state names instead of s0, s1, ... \end{lstlisting} \section{fsm\_extract -- extracting FSMs in design} \label{cmd:fsm_extract} \begin{lstlisting}[numbers=left,frame=single] fsm_extract [selection] This pass operates on all signals marked as FSM state signals using the 'fsm_encoding' attribute. It consumes the logic that creates the state signal and uses the state signal to generate control signal and replaces it with an FSM cell. The generated FSM cell still generates the original state signal with its original encoding. The 'fsm_opt' pass can be used in combination with the 'opt_clean' pass to eliminate this signal. \end{lstlisting} \section{fsm\_info -- print information on finite state machines} \label{cmd:fsm_info} \begin{lstlisting}[numbers=left,frame=single] fsm_info [selection] This pass dumps all internal information on FSM cells. It can be useful for analyzing the synthesis process and is called automatically by the 'fsm' pass so that this information is included in the synthesis log file. \end{lstlisting} \section{fsm\_map -- mapping FSMs to basic logic} \label{cmd:fsm_map} \begin{lstlisting}[numbers=left,frame=single] fsm_map [selection] This pass translates FSM cells to flip-flops and logic. \end{lstlisting} \section{fsm\_opt -- optimize finite state machines} \label{cmd:fsm_opt} \begin{lstlisting}[numbers=left,frame=single] fsm_opt [selection] This pass optimizes FSM cells. It detects which output signals are actually not used and removes them from the FSM. This pass is usually used in combination with the 'opt_clean' pass (see also 'help fsm'). \end{lstlisting} \section{fsm\_recode -- recoding finite state machines} \label{cmd:fsm_recode} \begin{lstlisting}[numbers=left,frame=single] fsm_recode [options] [selection] This pass reassign the state encodings for FSM cells. At the moment only one-hot encoding and binary encoding is supported. -encoding specify the encoding scheme used for FSMs without the 'fsm_encoding' attribute or with the attribute set to `auto'. -fm_set_fsm_file generate a file containing the mapping from old to new FSM encoding in form of Synopsys Formality set_fsm_* commands. -encfile write the mappings from old to new FSM encoding to a file in the following format: .fsm .map \end{lstlisting} \section{help -- display help messages} \label{cmd:help} \begin{lstlisting}[numbers=left,frame=single] help ............. list all commands help ... print help message for given command help -all ........ print complete command reference \end{lstlisting} \section{hierarchy -- check, expand and clean up design hierarchy} \label{cmd:hierarchy} \begin{lstlisting}[numbers=left,frame=single] hierarchy [-check] [-top ] hierarchy -generate In parametric designs, a module might exists in several variations with different parameter values. This pass looks at all modules in the current design an re-runs the language frontends for the parametric modules as needed. -check also check the design hierarchy. this generates an error when an unknown module is used as cell type. -purge_lib by default the hierarchy command will not remove library (blackbox) module. use this options to also remove unused blackbox modules. -libdir search for files named .v in the specified directory for unknown modules and automatically run read_verilog for each unknown module. -keep_positionals per default this pass also converts positional arguments in cells to arguments using port names. this option disables this behavior. -nokeep_asserts per default this pass sets the "keep" attribute on all modules that directly or indirectly contain one or more $assert cells. this option disables this behavior. -top use the specified top module to built a design hierarchy. modules outside this tree (unused modules) are removed. when the -top option is used, the 'top' attribute will be set on the specified top module. otherwise a module with the 'top' attribute set will implicitly be used as top module, if such a module exists. In -generate mode this pass generates blackbox modules for the given cell types (wildcards supported). For this the design is searched for cells that match the given types and then the given port declarations are used to determine the direction of the ports. The syntax for a port declaration is: {i|o|io}[@]: Input ports are specified with the 'i' prefix, output ports with the 'o' prefix and inout ports with the 'io' prefix. The optional specifies the position of the port in the parameter list (needed when instantiated using positional arguments). When is not specified, the can also contain wildcard characters. This pass ignores the current selection and always operates on all modules in the current design. \end{lstlisting} \section{hilomap -- technology mapping of constant hi- and/or lo-drivers} \label{cmd:hilomap} \begin{lstlisting}[numbers=left,frame=single] hilomap [options] [selection] Map constants to 'tielo' and 'tiehi' driver cells. -hicell Replace constant hi bits with this cell. -locell Replace constant lo bits with this cell. -singleton Create only one hi/lo cell and connect all constant bits to that cell. Per default a separate cell is created for each constant bit. \end{lstlisting} \section{history -- show last interactive commands} \label{cmd:history} \begin{lstlisting}[numbers=left,frame=single] history This command prints all commands in the shell history buffer. This are all commands executed in an interactive session, but not the commands from executed scripts. \end{lstlisting} \section{iopadmap -- technology mapping of i/o pads (or buffers)} \label{cmd:iopadmap} \begin{lstlisting}[numbers=left,frame=single] iopadmap [options] [selection] Map module inputs/outputs to PAD cells from a library. This pass can only map to very simple PAD cells. Use 'techmap' to further map the resulting cells to more sophisticated PAD cells. -inpad [:] Map module input ports to the given cell type with the given port name. if a 2nd portname is given, the signal is passed through the pad call, using the 2nd portname as output. -outpad [:] -inoutpad [:] Similar to -inpad, but for output and inout ports. -widthparam Use the specified parameter name to set the port width. -nameparam Use the specified parameter to set the port name. -bits create individual bit-wide buffers even for ports that are wider. (the default behavior is to create word-wide buffers using -widthparam to set the word size on the cell.) \end{lstlisting} \section{log -- print text and log files} \label{cmd:log} \begin{lstlisting}[numbers=left,frame=single] log string Print the given string to the screen and/or the log file. This is useful for TCL scripts, because the TCL command "puts" only goes to stdout but not to logfiles. -stdout Print the output to stdout too. This is useful when all Yosys is executed with a script and the -q (quiet operation) argument to notify the user. -stderr Print the output to stderr too. -nolog Don't use the internal log() command. Use either -stdout or -stderr, otherwise no output will be generated at all. -n do not append a newline \end{lstlisting} \section{ls -- list modules or objects in modules} \label{cmd:ls} \begin{lstlisting}[numbers=left,frame=single] ls [selection] When no active module is selected, this prints a list of modules. When an active module is selected, this prints a list of objects in the module. \end{lstlisting} \section{maccmap -- mapping macc cells} \label{cmd:maccmap} \begin{lstlisting}[numbers=left,frame=single] maccmap [-unmap] [selection] This pass maps $macc cells to yosys gate primitives. When the -unmap option is used then the $macc cell is mapped to $and, $sub, etc. cells instead. \end{lstlisting} \section{memory -- translate memories to basic cells} \label{cmd:memory} \begin{lstlisting}[numbers=left,frame=single] memory [-nomap] [-bram ] [selection] This pass calls all the other memory_* passes in a useful order: memory_dff opt_clean memory_share opt_clean memory_collect memory_bram -rules (when called with -bram) memory_map (skipped if called with -nomap) This converts memories to word-wide DFFs and address decoders or multiport memory blocks if called with the -nomap option. \end{lstlisting} \section{memory\_bram -- map memories to block rams} \label{cmd:memory_bram} \begin{lstlisting}[numbers=left,frame=single] memory_bram -rules [selection] This pass converts the multi-port $mem memory cells into block ram instances. The given rules file describes the available resources and how they should be used. The rules file contains a set of block ram description and a sequence of match rules. A block ram description looks like this: bram RAMB1024X32 # name of BRAM cell abits 10 # number of address bits dbits 32 # number of data bits groups 2 # number of port groups ports 1 1 # number of ports in each group wrmode 1 0 # set to '1' if this groups is write ports enable 4 0 # number of enable bits (for write ports) transp 0 2 # transparent (for read ports) clocks 1 2 # clock configuration clkpol 2 2 # clock polarity configuration endbram For the option 'transp' the value 0 means non-transparent, 1 means transparent and a value greater than 1 means configurable. All groups with the same value greater than 1 share the same configuration bit. For the option 'clocks' the value 0 means non-clocked, and a value greater than 0 means clocked. All groups with the same value share the same clock signal. For the option 'clkpol' the value 0 means negative edge, 1 means positive edge and a value greater than 1 means configurable. All groups with the same value greater than 1 share the same configuration bit. Using the same bram name in different bram blocks will create different variants of the bram. Verilog configuration parameters for the bram are created as needed. It is also possible to create variants by repeating statements in the bram block and appending '@