first commit
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
## Default .gitignore for VHDPlus Projects
|
||||
|
||||
## Ignore generated vhdl files, files generated by compiling with quartus
|
||||
Generated/
|
||||
incremental_db/
|
||||
output_files/
|
||||
db/
|
||||
|
||||
## MacOS
|
||||
.DS_Store
|
||||
|
||||
## ModelSim
|
||||
Modelsim/
|
||||
|
||||
## Quartus specific.
|
||||
## *.qsf
|
||||
## *.qpf
|
||||
|
||||
## ISSP
|
||||
Libraries/.qsys_edit
|
||||
|
||||
## NIOS
|
||||
*.map
|
||||
*.objdump
|
||||
*.elf
|
||||
*.flash
|
||||
*.sopcinfo
|
||||
|
||||
## Clangd
|
||||
.clangd/
|
||||
.cache/
|
||||
obj/
|
||||
mem_init/
|
||||
|
||||
## BSP Libraries
|
||||
**/Software/**/generated_bsp/
|
||||
**/Software/**/compile_commands.json
|
||||
|
||||
## Python
|
||||
*__pycache__*
|
||||
@@ -0,0 +1,7 @@
|
||||
<Project>
|
||||
<ItemGroup>
|
||||
<File Include="design.vhd" />
|
||||
<File Include="testbench.vhd" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup />
|
||||
</Project>
|
||||
@@ -0,0 +1,19 @@
|
||||
-- Code your design here
|
||||
library IEEE;
|
||||
use IEEE.std_logic_1164.all;
|
||||
|
||||
-- Entity HA
|
||||
entity halfadder is
|
||||
port (a_i : in std_logic;
|
||||
b_i : in std_logic;
|
||||
sum_o : out std_logic;
|
||||
cy_o : out std_logic);
|
||||
end halfadder;
|
||||
|
||||
-- Architecture HA
|
||||
architecture behavior of halfadder is
|
||||
begin
|
||||
-- HA is made out of 2 gates:
|
||||
sum_o <= a_i xor b_i;
|
||||
cy_o <= a_i and b_i;
|
||||
end behavior;
|
||||
Binary file not shown.
@@ -0,0 +1,38 @@
|
||||
-- Code your testbench here
|
||||
library IEEE;
|
||||
use IEEE.std_logic_1164.all;
|
||||
|
||||
-- Entity TB
|
||||
entity testbench is
|
||||
-- empty
|
||||
end testbench;
|
||||
|
||||
|
||||
-- Architecture TB
|
||||
architecture tb of testbench is
|
||||
|
||||
-- DUT component declaration
|
||||
component halfadder is
|
||||
port (a_i : in std_logic;
|
||||
b_i : in std_logic;
|
||||
sum_o : out std_logic;
|
||||
cy_o : out std_logic);
|
||||
end component;
|
||||
|
||||
-- declare signals
|
||||
signal sig_a, sig_b, sig_sum, sig_cy: std_logic;
|
||||
|
||||
begin
|
||||
|
||||
-- DUT instantiation and port mapping
|
||||
DUT: halfadder port map(
|
||||
a_i => sig_a,
|
||||
b_i => sig_b,
|
||||
sum_o => sig_sum,
|
||||
cy_o => sig_cy);
|
||||
|
||||
-- apply testpattern
|
||||
sig_a <= '0', '1' after 100 ns, '0' after 200 ns, '1' after 300 ns;
|
||||
sig_b <= '0', '1' after 200 ns;
|
||||
|
||||
end tb;
|
||||
@@ -0,0 +1,12 @@
|
||||
# auto-generated
|
||||
[Libraries]
|
||||
work.files = [
|
||||
'design.vhd',
|
||||
'testbench.vhd'
|
||||
]
|
||||
[libraries.work]
|
||||
files = [
|
||||
'design.vhd',
|
||||
'testbench.vhd'
|
||||
]
|
||||
# auto-generated-end
|
||||
Reference in New Issue
Block a user