ByteBench is small VHDL project that implements a synchronous RAM module with a testbench to simulate read and write operations. This Project helps in learning:
- VHDL arrays and memory structures
- Synchronous read/write logic
- Writing testbenches for simulations
- Using GHDL and GTKWave for simulation on Linux
- Data width: 8 bits
- Address width: 4 bits -> 16 memory locations
- Inputs:
clk- clockrw- read/write controladdr- address to read/writedata_in- data to write
- Output:
data_out- data read from memory
Install GHDL and GTKWave
sudo apt install ghdl gtkwave
Compile VHDL files
ghdl -a src/ram.vhdl
ghdl -a src/testbench.vhdl
Elaborate the testbench
ghdl -e tb_ram # tb_ram is entity in testbench.vhdl
Run the simulation and generate waveform
ghdl -r tb_ram --vcd=ram.vcd --stop-time=500ns
View waveforms
gtkwave ram.vcd
by Krushang Patel