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 --MAE
process(clk_100MHz, reset) process(clk_100MHz, reset)
begin begin
if reset = '1' then fs <= idle; if reset = '1' then
fs <= idle;
elsif rising_edge(clk_100MHz) then elsif rising_edge(clk_100MHz) then
if cs = idle then if cs = idle then
@ -42,15 +44,17 @@ begin
out_value <= '0'; out_value <= '0';
if cpt > 99 then fs <= out_1; if cpt >= 99 then
fs <= out_1;
end if; end if;
elsif cs = out_1 then elsif cs = out_1 then
out_value <= '1'; out_value <= '1';
if cpt > 199 then if cpt >= 199 then
fs <= idle; fs <= idle;
out_value <= '0';
fin <= '1'; fin <= '1';
inc_cpt <= '0'; inc_cpt <= '0';
end if; end if;
@ -72,6 +76,8 @@ begin
if inc_cpt = '1' then if inc_cpt = '1' then
cpt <= cpt + 1; cpt <= cpt + 1;
else
cpt <= 0;
end if; end if;
end if; end if;