[PYTHON] Before trying Veriloggen on Windows

wrap up

I tried to use the library Veriloggen that can write Verilog in Python with Windows + Visual Studio. Then there was an error related to the simulation, so I fixed it.

Try to use

Now that I'm free, I'll try using Veriloggen, which I've always been interested in. I also use Python for the first time.

Quickly install the VS Python extension for the time being I can't do anything without the support of the IDE because it's spacious.

Create a virtual environment on VS and install Veriloggen and dependent packages with pip

When I run the sample code

...
endmodule


C:\Users\*******\AppData\Local\Temp\tmp16lswu9y: Permission denied
No top level modules, and no -s option.
'.'Is an internal or external command,
It is not recognized as an operable program or batch file.

Ouf

Try to fix it

It seems that something is wrong with the simulation, so Take a look at Veriloggen's simulation.py.

First of all, Permission.

simulation.py


tmp = tempfile.NamedTemporaryFile()
tmp.write(code.encode(encode))
tmp.read()
filename = tmp.name

cmd.append(filename)

# synthesis
p = subprocess.Popen(' '.join(cmd), shell=True, stdout=subprocess.PIPE)

Because Permission says something like this Something is wrong with this temporary file.

After a lot of research, about tempfile.NamedTemporaryFile () I glance at something disturbing about the Windows environment. So, you can use mkstemp () (I'm not sure), so I'll try it. Reference

simulation.py


# tmp = tempfile.NamedTemporaryFile()
fd, path = tempfile.mkstemp()
os.close(fd)
tmp = open(path, "w+b")

tmp.write(code.encode(encode))
tmp.read()
filename = tmp.name

#Omission

# close temporal source code file
tmp.close()
os.remove(path)

For the time being, I didn't say anything about Permission.

Then this line

simulation.py


# simulation
p = subprocess.Popen('./' + outputfile, shell=True, stdout=subprocess.PIPE)

Rewrite ./ to . \\. that's all.

After executing so far, the simulation ran. Hooray

Recommended Posts

Before trying Veriloggen on Windows
Python on Windows
Pylint on Windows Atom
Linux (WSL) on Windows
Use pyvenv on Windows
Anaconda on Windows Terminal
Install Anaconda on Windows 10
python basic on windows ②
Install python on windows
Install pycuda on Windows10
Build TensorFlow on Windows
Try FEniCS on Windows!
Build XGBoost on Windows
Install pygraphviz on Windows 10
Use Ansible on Windows
Try Poerty on Windows
Install Chainer 1.5.0 on Windows
Use QuTiP on Windows
Use pip on Windows
Set-enable Python virtualenv on Windows
Install watchdog on Windows + Python 3.3
Install Win-Kex (kali-linux) on Windows 10.
Install cvxpy on windows, Anaconda
Python + Kivy development on Windows
Prepare Chainer environment on Windows
Try using OpenCV on Windows
F2py on Miniconda for Windows
Sphinx-autobuild (0.5.2) on Windows7, Python 3.5.1, Sphinx 1.3.5
Make Cython available on Windows.
Fastest Python installation on Windows
Operate ubuntu on VScode (windows10)
Build Python environment on Windows
Django environment development on Windows 10
Install Chainer 1.6 (GPU) on Windows 7.
Build python environment on windows
Set up Polyglot on Windows
Linux on Windows -1-: debian introduction
I ran python on windows
[Tensorflow] Tensorflow environment construction on Windows 10
Notes on installing Anaconda 3 on Windows
[Python] [Chainer] [Windows] Install Chainer on Windows
Use Python on Windows (PyCharm)
Run Jupyter Notebook on windows
Use Linux on Windows 10 (WSL2)
Blogging with Pelican on Windows
Python environment construction memo on Windows 10
Remove ubuntu installed on Windows 10 machine
Python 3.6 on Windows ... and to Xamarin.
Installing Kivy on Windows10 64bit Python3.5
Pip install --ugrade pip fails on Windows
Anaconda python environment construction on Windows 10
How to use Dataiku on Windows
Drawing graphs on Windows10 + Julia + PyPlot
Install python2.7 on windows 32bit environment
Install xgboost (python version) on Windows
Install Python on Windows + pip + virtualenv
WSL2 ~ Linux on Windows ~ (Part 1: Introduction)
Run Tensorflow natively supported on windows
Build and install OpenCV on Windows
Install Pytorch on Blender 2.90 python on Windows
How to install pycrypto on Windows