first commit

This commit is contained in:
2025-02-10 20:28:13 +01:00
commit e2ef356f15
170 changed files with 4884 additions and 0 deletions
+40
View File
@@ -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__*
+8
View File
@@ -0,0 +1,8 @@
<Project>
<ItemGroup>
<File Include="clkgen.vhd" />
<File Include="design.vhd" />
<File Include="testbench.vhd" />
</ItemGroup>
<PropertyGroup />
</Project>
+24
View File
@@ -0,0 +1,24 @@
-- Clock Generator
library IEEE;
use IEEE.std_logic_1164.all;
entity clkGen is
port (clk : out std_logic);
end clkGen;
architecture behavior of clkGen is
constant clk_period : time := 10 ns;
begin
clkgen : process
begin
clk <= '0';
wait for clk_period/2;
clk <= '1';
wait for clk_period/2;
end process clkgen;
end behavior;
+24
View File
@@ -0,0 +1,24 @@
-- Code your design here
library IEEE;
use IEEE.std_logic_1164.all;
entity myDFF is
port ( clk:in std_logic;
D:in std_logic;
reset:in std_logic;
Q:out std_logic);
end myDFF;
architecture beh of myDFF is
begin
DFF: process ( Clk, reset )
begin
If reset ='1' then
Q <='0';
Elsif (Clk'event and Clk ='1') then
Q <= D ;
end if ;
end process DFF;
end beh;
+60
View File
@@ -0,0 +1,60 @@
-- Code your testbench here
library IEEE;
use IEEE.std_logic_1164.all;
entity testbench is
end testbench;
architecture tb of testbench is
component myDFF is
port ( clk:in std_logic;
D:in std_logic;
reset:in std_logic;
Q:out std_logic);
end component;
component clkGen is
port (clk : out std_logic);
end component;
signal sig_D, sig_clk, sig_Q, sig_reset : std_logic;
begin
DUT: myDFF port map(
clk => sig_clk,
D => sig_D,
reset => sig_reset,
Q => sig_Q
);
mClkGen : clkGen port map(
clk => sig_clk
);
res_stim : process
begin
sig_reset <= '0';
wait for 2 ns;
sig_reset <= '1';
wait for 10 ns;
sig_reset <= '0';
wait for 20 ns;
sig_reset <= '1';
wait for 1 ns;
sig_reset <= '0';
wait;
end process res_stim;
d_stim : process
begin
sig_D <= '0';
wait for 17 ns;
sig_D <= '1';
wait for 30 ns;
sig_D <= '0';
wait;
end process d_stim;
end tb;
+8
View File
@@ -0,0 +1,8 @@
# auto-generated
[Libraries]
work.files = [
]
[libraries.work]
files = [
]
# auto-generated-end