DCC_Bit_0 TB

This commit is contained in:
Adrien Bourmault 2022-03-21 12:23:01 +01:00
parent 9e78c99990
commit b85ba604ff
No known key found for this signature in database
GPG Key ID: 6EB408FE0ACEC664
1 changed files with 12 additions and 6 deletions

View File

@ -25,7 +25,9 @@ begin
--MAE
process(clk_100MHz, reset)
begin
if reset = '1' then fs <= idle;
if reset = '1' then
fs <= idle;
elsif rising_edge(clk_100MHz) then
if cs = idle then
@ -42,15 +44,17 @@ begin
out_value <= '0';
if cpt > 99 then fs <= out_1;
if cpt >= 99 then
fs <= out_1;
end if;
elsif cs = out_1 then
out_value <= '1';
if cpt > 199 then
if cpt >= 199 then
fs <= idle;
out_value <= '0';
fin <= '1';
inc_cpt <= '0';
end if;
@ -58,7 +62,7 @@ begin
end if;
cs <= fs;
end if;
end process;
--Compteur de Temporisation
@ -69,11 +73,13 @@ begin
cpt <= 0;
elsif rising_edge(clk_1MHz) then
if inc_cpt = '1' then
cpt <= cpt + 1;
else
cpt <= 0;
end if;
end if;
end process;