Last active
July 13, 2022 09:30
-
-
Save pcornier/2da9976a9d5603f717e384a88ff30fd5 to your computer and use it in GitHub Desktop.
yosys/ghdl -> verilog (VHDL to Verilog with Yosys & GHDL)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# make sure it's python 2.7 | |
sudo update-alternatives --config python | |
# build ghdl | |
sudo apt install -y git make gnat zlib1g-dev | |
git clone https://github.com/ghdl/ghdl | |
cd ghdl | |
./configure --prefix=/usr/local | |
make | |
sudo make install | |
# build ghdl-yosys-plugin | |
git clone https://github.com/ghdl/ghdl-yosys-plugin | |
cd ghdl-yosys-plugin | |
make | |
sudo mkdir /usr/local/share/yosys/plugins | |
sudo cp ghdl.so /usr/local/share/yosys/plugins | |
# convert vhdl files | |
ls test | |
- ctc.vhdl | |
- ctc_channel.vhdl | |
# create .cf file | |
cd test | |
ghdl -a *.vhd | |
# load and compile | |
yosys -m ghdl | |
yosys> ghdl ctc | |
yosys> proc; opt; fsm; opt; memory; opt; | |
# write verilog | |
yosys> write_verilog ctc | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ghdl synth --out=verilog
for example: ghdl synth --ieee=synopsys -fexplicit --out=verilog vdp > vdp.v
or:
ghdl -a --std=08 P65816_pkg.vhd BCDAdder.vhd AddSubBCD.vhd AddrGen.vhd MCode.vhd P65C816.vhd ALU.vhd
ghdl synth --std=08 --out=verilog P65C816 > P65C816.v