Synthese Logique
[ EN COURS DE REDACTION ]
à propos de la synthèse logique open source :
site de Fabien Marteau
Carte Icebreaker avec FPGA LATTICE ICE40UP5k
DOCUMENTATION
https://github.com/icebreaker-fpga
Horloge 12MHz
Installations
Chaîne de développement
Avec le logiciel de simulation ghdl, le forçage des signaux d’entrée d’un composant à tester nécessite l’utilisation
d’un composant testbench, à savoir un composant incluant le composant à tester
Dans notre exemple, le composant à tester est le composant icebreaker, décrit dans le fichier vhdl icebreaker.vhd.
Le test nécessite un composant icebreaker_tb, décrit dans le fichier vhdl cicebreaker_tb.vhd, dans lequel on instancie icebreaker.
Composants |
Testbench |
library IEEE;
use IEEE.std_logic_1164.all;
-- Pressing button 1 (A) and/or 2 (B) will compare the two signals
-- and enable one of the built-in LEDs:
-- A < B: L2
-- A = B: L1
-- A > B: L3
entity icebreaker is
port( BTN1, BTN2, CLK : in std_logic;
LED1, LED2, LED3 : out std_logic);
end entity icebreaker;
architecture arch_icebreaker of icebreaker is
begin
process(CLK)
begin
if rising_edge(CLK) then
if BTN1>BTN2 then LED1 <= '1'; LED2 <= '0'; LED3 <= '0';
elsif BTN1=BTN2 then LED1 <= '0'; LED2 <= '1'; LED3 <= '0';
elsif BTN1<BTN2 then LED1 <= '0'; LED2 <= '0'; LED3 <= '1';
else LED1 <= '0'; LED2 <= '0'; LED3 <= '0';
end if;
end if;
end process;
end arch_icebreaker;
|
library IEEE;
use IEEE.std_logic_1164.all;
use work.all;
entity icebreaker_tb is
end icebreaker_tb;
architecture arch_icebreaker_tb of icebreaker_tb is
signal BTN1, BTN2, LED1, LED2, LED3, CLK : std_logic;
constant CLK_period : time := 83333 ps; --12MHz
begin
icebreaker_0 : entity icebreaker port map (
BTN1 => BTN1,
BTN2 => BTN2,
CLK => CLK,
LED1 => LED1,
LED2 => LED2,
LED3 => LED3
);
-- Clock definition.
CLK_process :process
begin
CLK <= '0';
wait for CLK_period / 2;
CLK <= '1';
wait for CLK_period / 2;
end process;
stimuli: process
begin
BTN1 <= '0'; BTN2 <= '0'; -- Initial conditions.
wait for 1 ms;
BTN1 <= '0'; BTN2 <= '1';
wait for 1 ms;
BTN1 <= '1'; BTN2 <= '0';
wait for 1 ms;
BTN1 <= '1'; BTN2 <= '1';
wait;
end process;
end arch_icebreaker_tb;
|
Chaîne de développement
Sources
cmp_1bit.zip
COMPILATION
SIMULATION
Dans gtkwave, sélectionner l’entité de plus haut niveau ( icebreaker_tb ), et faire clic droit –> Recursive Import –> Insert
REMARQUE : dans gtkwave, pour sauvegarder la configuration , faire File –> write save file –> layout.gtkw
SYNTHESE LOGIQUE