Suppress Specific IP Warnings in Modelsim - tcl

A Vivado IP is generating an inordinate amount of Modelsim warnings which are making it difficult to assess the simulation for warnings I actually care about.
I see from the Modelsim command documentation that in order to suppress a warning I need to include the parameter -suppress and then the warning numbers. My current implementation is as follows...
vsim -voptargs=+acc \
-L work \
-L xil_defaultlib \
-L secureip \
-L simprims_ver \
-L unifast_ver \
-L unimacro_ver \
-L unisims_ver \
-L xpm \
-L fifo_generator_v13_1_1 \
-L blk_mem_gen_v8_3_3 \
work.blr_tb xil_defaultlib.glbl -l sv_sim.log -suppress 3015,3017,3722
This code snippet works but I am afraid that this will suppress warnings that are created by problems with my own rtl. Is there a way of suppressing specific warnings of an IP?
For reference the warnings are all from the Vivado MIG IP and look something like this...
# ** Warning: (vsim-3017) ../../ip/xc7k160t2ffg676-2/mig_ddr3_64bit_32G/mig_ddr3_64bit_32G/user_design/rtl/phy/mig_7series_v4_0_ddr_mc_phy_wrapper.v(1260): [TFMPC] - Too few port connections. Expected 9, found 8.
# Time: 0 fs Iteration: 0 Instance: /blr_tb/blr_sbk_top_i/ddr3_balor_i/u_mig_ddr3_64bit_32G/u_mig_ddr3_64bit_32G_mig/u_memc_ui_top_std/mem_intfc0/ddr_phy_top0/u_ddr_mc_phy_wrapper/gen_dqs_iobuf_HP/gen_dqs_iobuf[0]/gen_dqs_diff/u_iobuf_dqs File: C:/Xilinx/Vivado/2016.2/data/verilog/src/unisims/IOBUFDS_DIFF_OUT_DCIEN.v
The MIG is compiled with the following command...
vlog -work xil_defaultlib -incr \
"$SBK_IP_DIR/mig_ddr3_64bit_32G/mig_ddr3_64bit_32G/user_design/rtl/mig_ddr3_64bit_32G.v" \
"$SBK_IP_DIR/mig_ddr3_64bit_32G/mig_ddr3_64bit_32G/user_design/rtl/mig_ddr3_64bit_32G_mig_sim.v" \
"$SBK_IP_DIR/mig_ddr3_64bit_32G/mig_ddr3_64bit_32G/user_design/rtl/clocking/*.v" \
"$SBK_IP_DIR/mig_ddr3_64bit_32G/mig_ddr3_64bit_32G/user_design/rtl/controller/*.v" \
"$SBK_IP_DIR/mig_ddr3_64bit_32G/mig_ddr3_64bit_32G/user_design/rtl/ecc/*.v" \
"$SBK_IP_DIR/mig_ddr3_64bit_32G/mig_ddr3_64bit_32G/user_design/rtl/ip_top/*.v" \
"$SBK_IP_DIR/mig_ddr3_64bit_32G/mig_ddr3_64bit_32G/user_design/rtl/phy/*.v" \
"$SBK_IP_DIR/mig_ddr3_64bit_32G/mig_ddr3_64bit_32G/user_design/rtl/ui/*.v"

Related

Qemu device loader doesnt load value into memory

Im trying to use the -device,loader option in qemu. Originally, I wanted to load a file into memory, but that was (and still isnt) working. So, I tried to load a constant value into memory. This is my command:
qemu-system-aarch64 \
-machine virt \
-cpu cortex-a57 \
-smp 1 \
-m 3G \
-device loader,addr=0x14680000,data=0xdeadbeef,data-len=0x4\
-machine gic-version=3 \
-machine secure=true \
-machine virtualization=true \
-nographic \
-S -s
I then open gdb, and do:
target remote :1234
x/x 0x14680000
The result is not 0xdeadbeef, as I had expected, but 0xffffffff.
Why is this happening? I cant find much documentation on the loader device in qemu, and have mostly just been following:
https://qemu-project.gitlab.io/qemu/system/generic-loader.html

how to log into cloud image using qemu

I am following this guide https://powersj.io/posts/ubuntu-qemu-cli/ but i seem to get stuck in the login prompt at when i run
qemu-system-x86_64 \
-machine accel=kvm,type=q35 \
-cpu host \
-m 2G \
-nographic \
-device virtio-net-pci,netdev=net0 \
-netdev user,id=net0,hostfwd=tcp::2222-:22 \
-drive if=virtio,format=qcow2,file=focal-server-cloudimg-amd64.img \
-drive if=virtio,format=raw,file=seed.img
I dont know what the user and password would be. I also am unable to exit this screen so I have to open another terminal and kill it.
Do I need to leave an `&` to leave it running in background?

QEMU-KVM automatically set filterref parameter

I'm sorry if this is a simple question, but I am just starting out with qemu and can't find a easy way to do this.
I am trying to somewhat automate my KVM deployment. I am currently running into the issue that I can't find a way to automatically set parameters for a filterref.
This is what my network option for virt-install currently looks like and that is working fine for now.
--network type=bridge,network=default,bridge=bridge0,model=e1000e,mac=$mac,filterref=clean-traffic
However I can't find anything to set a parameter to define the IP address it's supposed to be locked down to. This is the result that I want in the xml:
<filterref filter='clean-traffic'>
<parameter name='IP' value='XXX.XXX.XXX.XXX'/>
</filterref>
I am looking for a way to automatically add that parameter, preferably directly with virt-install or to an extent were I can just run a script, enter the few variables I want to set. And at this point the VM would already be running and waiting for the setup to be completed, with the filter loaded. Basically I want the parameter to be loaded before the first startup, so that there is no chance of anyone trying to mess with the ip address.
Is this possible?
This is the whole "script" I just copy into the console at the moment.
name=WindowsTest
mac=00:50:56:00:05:C5
size=70
ram=6000
vcpus=6
let cores=vcpus/2
virt-install \
--name=$name \
--ram=$ram \
--cpu=host \
--vcpus=$vcpus,maxvcpus=$vcpus,sockets=1,cores=$cores,threads=2 \
--os-type=windows \
--os-variant=win10 \
--disk path=/var/lib/libvirt/clutchImages/$name.qcow2,size=$size,format=qcow2,bus=virtio \
--cdrom /var/isos/Windows_20H2_English.iso \
--disk /var/isos/virtio-win-0.1.185.iso,device=cdrom \
--network type=bridge,network=default,bridge=bridge0,model=e1000e,mac=$mac,filterref=clean-traffic \
--graphics spice,listen=157.90.2.208 \
--graphics vnc
virsh version output:
virsh version
Compiled against library: libvirt 6.0.0
Using library: libvirt 6.0.0
Using API: QEMU 6.0.0
Running hypervisor: QEMU 4.2.0
I am on CentOS Linux release 8.3.2011.
Make arbitrary edits to virt-install's xml output
According to the man page you can make direct edits to the XML using XPath
syntax.
e.g.
virt-install \
#...
--network network="${net}",mac="${macaddr},filterref.filter=clean-traffic" \
--xml xpath.create=./devices/interface/filterref/parameter \
--xml xpath.set=./devices/interface/filterref/parameter/#name=IP \
--xml xpath.set=./devices/interface/filterref/parameter/#value=10.0.0.20
#...
virt-install man page excerpt:
man virt-install | grep -m1 -A40 '\-\-xml'
--xml
Syntax: --xml ARGS
Make direct edits to the generated XML using XPath syntax. Take an ex‐
ample like
virt-install --xml ./#foo=bar --xml ./newelement/subelement=1
This will alter the generated XML to contain:
<domain foo='bar' ...>
...
<newelement>
<subelement>1</subelement>
</newelement>
</domain>
The --xml option has 4 sub options:
--xml xpath.set=XPATH[=VALUE]
The default behavior if no explicit suboption is set. Takes the
form XPATH=VALUE unless paired with xpath.value . See below for
how value is interpreted.
--xml xpath.value=VALUE
xpath.set will be interpreted only as the XPath string, and
xpath.value will be used as the value to set. May help sidestep
problems if the string you need to set contains a '=' equals
sign.
If value is empty, it's treated as unsetting that particular
node.
--xml xpath.create=XPATH
Create the node as an empty element. Needed for boolean elements
like <readonly/>
--xml xpath.delete=XPATH
Delete the entire node specified by the xpath, and all its chil‐
dren
XML result
<interface type="network">
<!-- ... -->
<filterref filter="clean-traffic">
<parameter name="IP" value="10.0.0.20"/>
</filterref>
</interface>
virsh version output:
Compiled against library: libvirt 7.7.0
Using library: libvirt 7.7.0
Using API: QEMU 7.7.0
Running hypervisor: QEMU 6.2.0
Quick & dirty
name=WindowsTest
mac=00:50:56:00:05:C5
IP=xxx.yyy.zzz.qqq
size=70
ram=6000
vcpus=6
let cores=vcpus/2
virt-install \
--name=$name \
--ram=$ram \
--cpu=host \
--vcpus=$vcpus,maxvcpus=$vcpus,sockets=1,cores=$cores,threads=2 \
--os-type=windows \
--os-variant=win10 \
--disk path=/var/lib/libvirt/clutchImages/$name.qcow2,size=$size,format=qcow2,bus=virtio \
--cdrom /var/isos/Windows_20H2_English.iso \
--disk /var/isos/virtio-win-0.1.185.iso,device=cdrom \
--network type=bridge,network=default,bridge=bridge0,model=e1000e,mac=$mac,filterref=clean-traffic \
--graphics spice,listen=157.90.2.208 \
--graphics vnc
--print-xml > /tmp/{$name}.xml && \
sed -i "s/<filterref.*/<filterref filter='clean-traffic'>\n <parameter name='IP' value='${IP}'\/>\n <\/filterref>/g" /tmp/{$name}.xml && \
virsh create /tmp/{$name}.xml

How to pass arguments from cmd to tcl script of ModelSim

I run Modelsim in the cmd from a python program.
I use the following code which call a tcl script which run the modelsim:
os.system("vsim -c -do top_tb_simulate_reg.tcl " )
The tcl script contain the following:
vsim -voptargs="+acc" +UVM_TESTNAME=test_name +UVM_MAX_QUIT_COUNT=1 +UVM_VERBOSITY=UVM_LOW \
-t 1ps -L unisims_verm -L generic_baseblocks_v2_1_0 -L axi_infrastructure_v1_1_0 \
-L dds_compiler_v6_0_12 -lib xil_defaultlib xil_defaultlib.girobo2_tb_top \
xil_defaultlib.glbl
I want that the value of the +UVM_TESTNAME will be an argument which I passed from the cmd when I execute:
os.system("vsim -c -do top_tb_simulate_reg.tcl " )
How can I do it?
I tried the following with no succees:
Python script:
os.system("vsim -c -do top_tb_simulate_reg.tcl axi_rd_only_test" )
Simulation file (tcl script)
vsim -voptargs="+acc" +UVM_TESTNAME=$argv +UVM_MAX_QUIT_COUNT=1 +UVM_VERBOSITY=UVM_LOW \
-t 1ps -L unisims_verm -L generic_baseblocks_v2_1_0 -L axi_infrastructure_v1_1_0 \
-L dds_compiler_v6_0_12 -lib xil_defaultlib xil_defaultlib.girobo2_tb_top \
xil_defaultlib.glbl
I got the following error:
# ** Error: (vsim-3170) Could not find 'C:/raft/raftortwo/girobo2/ver/sim/work.axi_rd_only_test'.
The problem is that the vsim binary is doing its own processing of the arguments, and that is interfering. While yes, you can probably find a way around this by reading the vsim documentation, the simplest way around this is to pass values via environment variables. They're inherited by a process from its parent process, and are fine for passing most things. (The exception are security tokens, which should always be passed in files with correctly-set permissions, rather than either environment variables or command-line arguments.)
In your python code:
# Store the value in the *inheritable* environment
os.environ["MY_TEST_CASE"] = "axi_rd_only_test"
# Do the call; the environment gets passed over behind the scenes
os.system("vsim -c -do top_tb_simulate_reg.tcl " )
In your tcl code:
# Read out of the inherited environment
set name $env(MY_TEST_CASE)
# Use it! (Could do this as one line, but that's hard to read)
vsim -voptargs="+acc" +UVM_TESTNAME=$name +UVM_MAX_QUIT_COUNT=1 +UVM_VERBOSITY=UVM_LOW \
-t 1ps -L unisims_verm -L generic_baseblocks_v2_1_0 -L axi_infrastructure_v1_1_0 \
-L dds_compiler_v6_0_12 -lib xil_defaultlib xil_defaultlib.girobo2_tb_top \
xil_defaultlib.glbl
Late to the party but I found a great workaround for your obstacle. The do command within Modelsim's TCL instance does accept parameters. See command reference.
vsim -c -do filename.tcl can't take parameters, but you can use vsim -c -do "do filename.tcl params".
In your case this translates to os.system('vsim -c -do "do top_tb_simulate_reg.tcl axi_rd_only_test"'). Your .tcl script will find the parameter passed through the variable $1.
I hope to helps anyone!

How to ignore directories in OpenGrok index?

I am trying to setup OpenGrok to search through a few GB of code, mostly Java and Python projects. I use opengrok-0.12.1/bin/OpenGrok index $SRC_ROOT to build the index. I can see it indexing Java's "target" and Python's ".tox" directories which I don't need.
I searched online and found the same question in many forums, and the answer being to use -i. I have tried to use this option with both the OpenGrok wrapper script as well as opengrok.jar, but all I get is the help message (because the command line options were apparently wrong).
Could you give me an example command to build indices that ignore certain directories?
The solution is to use the -i flag. The best way to do this is to create a .conf file. For example, I have the following file defined as opengrok.conf:
OPENGROK_APP_SERVER=Tomcat
OPENGROK_TOMCAT_BASE=/usr/local/Cellar/tomcat/8.0.21/libexec
OPENGROK_SCAN_DEPTH=4
OPENGROK_VERBOSE=yes
OPENGROK_PROGRESS=yes
IGNORE_PATTERNS="-i f:foo.txt -i *.bar -i d:target -i d:.tox"
And run the indexing using:
OPENGROK_CONFIGURATION=opengrok.conf ./OpenGrok index $SRC_ROOT
It ignores indexing the file foo.txt, all files that match the pattern *.bar, and all files in directories named target or .tox.
Edit credits: mrenaud, pcas
Note that https://github.com/oracle/opengrok/pull/1841 renamed IGNORE_PATTERNS to OPENGROK_IGNORE_PATTERNS (in Oct 2017).
https://github.com/oracle/opengrok/wiki/How-to-setup-OpenGrok
java -jar opengrok-1.3.16/lib/opengrok.jar --help
-i, --ignore pattern
Ignore matching files (prefixed with 'f:' or no prefix) or directories
(prefixed with 'd:'). Pattern supports wildcards (example: -i '*.so'
-i d:'test*'). Option may be repeated.
with the new opengrok-tools, it looks like
opengrok-indexer \
--java_opts=-Djava.util.logging.config.file=$(OPENGROK_BASE)/etc/logging.properties \
--jar $(OPENGROK_DIST)/lib/opengrok.jar -- \
--ctags /usr/local/bin/ctags \
--source $(PWD) \
--dataRoot $(OPENGROK_BASE)/data \
--progress \
--history \
--assignTags \
--writeConfig $(OPENGROK_BASE)/etc/configuration.xml \
--analyzer .sc:ScalaAnalyzer \
--ignore 'd:zold' \
--ignore 'd:opengrok' \
--ignore 'd:tmp' \
--ignore 'd:.venv' \
--ignore 'd:.ipynb_checkpoints' \
--ignore 'd:.metals' \
# END