cr1901 has quit [Read error: Connection reset by peer]
cr1901 has joined #yosys
cr1901 has quit [Ping timeout: 276 seconds]
cr1901 has joined #yosys
cr1901 has quit [Read error: Connection reset by peer]
cr1901 has joined #yosys
_whitelogger has joined #yosys
FabM has joined #yosys
FabM has joined #yosys
srk has quit [Ping timeout: 268 seconds]
srk has joined #yosys
Guest29 has joined #yosys
<Guest29>
Hi
<Guest29>
I am running Yosys for Synthesis
<Guest29>
I am using *.ys files
<Guest29>
So in *.ys file, how can we define variable ?
<Guest29>
Like read_verilog $XYZ/rtl_path/abc.v
<jix>
you can't, you need to use TCL if you need that
<jix>
(or alternatively generate .ys files from some other form of script)
<Guest29>
Can you help me how by TCL ? I have tried with yosys -c <*.tcl> and I have declared read_verilog $XYZ/rtl_path/abc.v in TCL but not working
<jix>
in TCL you need to either prefix commands with the yosys command so it would be `yosys read_verilog $XYZ/rtl_path/abc.v` in the TCL script (not including the `)
<jix>
alternatively you can run the TCL command `yosys -import` at the start to make all non-conflicting yosys commands available as TCL commands directly
<Guest29>
Ok. Thanks. At the start mean ? > I use this command - yosys -l yosys_run.log -s yosys_script.ys
<jix>
no you use `yosys -l yosys_run.log -c yosys_script.tcl` but then at the top of `yosys_script.tcl` you run `yosys -import` as the first TCL command
<jix>
(or alternatively in `yosys_script.tcl` you prefix every yosys command with `yosys` e.g. `yosys read_verilog ....`)
<Guest29>
Ok
<jix>
and if you want to access environment variables, not TCL variables, you need to use $::env(VAR_NAME)
<jix>
but that's just standard TCL
<Guest29>
Suppose I have multiple commands like read_libert, read_verilog , synth, difflibmap etc ....
<Guest29>
Suppose above commands are in *.ys, Now I have converted to TCL so for each command I have to write yosys ?
<jix>
You have two choices, 1) you run `yosys -import` once at the top of the .tcl file or 2) you write `yosys` before every command
<jix>
but some yosys commands have names that are already existing commands in TCL, so if you use `yosys -import` you have to watch out for those since they will have a different name