Pano Logic G1: Programa VHDL "Hola Mundo"

Cores exclusivos para la Pano Logic G1 ó G2 (sus cores NO son intercambiables)

Moderador: antoniovillena

benitoss
PLA
Mensajes: 43
Registrado: 07 Oct 2018, 04:53

Pano Logic G1: Programa VHDL "Hola Mundo"

Mensaje por benitoss » 22 Dic 2018, 07:15

Aqui teneis el VHDL "Hola mundo" para la Pano Logic G1 (VGA)
El ejemplo hace parpadear los LEDs rojo y verde y alternativamente el LED azul

Archivo hello_world.vhdl

Código: Seleccionar todo

    library ieee;
    use ieee.std_logic_1164.all;
    use ieee.numeric_std.all;

    entity hello_world is

    port (
        clk     		: in std_logic;
        led_green         : out std_logic;
	led_blue           : out std_logic;
	led_red             : out std_logic
		  
    );
    end hello_world;

    architecture rtl of hello_world is

        constant CLK_FREQ : integer := 20000000;
        constant BLINK_FREQ : integer := 1;
        constant CNT_MAX : integer := CLK_FREQ/BLINK_FREQ/2-1;

        signal cnt      : unsigned(24 downto 0);
        signal blink    : std_logic;

    begin

        process(clk)
        begin

            if rising_edge(clk) then
                if cnt=CNT_MAX then
                    cnt <= (others => '0');
                    blink <= not blink;
                else
                    cnt <= cnt + 1;
                end if;
            end if;

        end process;

        led_red <= NOT blink;
		  led_green <= NOT blink;
		  led_blue <= blink;

    end rtl;
Archivo constrain file hello_world.ucf

Código: Seleccionar todo

# 100MHZ Oscillator
#NET "osc_clk" LOC = U10 |IOSTANDARD = LVCMOS33;



#============================================================
# IDT ICS307 Clock Generator
#============================================================

#NET "idt_sclk"   LOC = F2  |IOSTANDARD = LVCMOS33;
#NET "idt_strobe" LOC = G5  |IOSTANDARD = LVCMOS33;
#NET "idt_data"   LOC = F1  |IOSTANDARD = LVCMOS33;

#NET "idt_iclk"   LOC = J2  |IOSTANDARD = LVCMOS33;
NET "clk"   LOC = J4  |IOSTANDARD = LVCMOS33;
 
#============================================================
# Button
#============================================================

#NET "button"  LOC = R7  |IOSTANDARD = LVCMOS33;

#============================================================
# LEDs
#============================================================

NET "led_green" LOC = H1  |IOSTANDARD = LVCMOS33;
NET "led_blue"  LOC = L1  |IOSTANDARD = LVCMOS33;
NET "led_red"   LOC = L3  |IOSTANDARD = LVCMOS33;   # Is this an input or an output, coming from the Micrel PHY?
 
En el adjunto, aparte de las fuentes, teneis el bit y el svf file para poder programarlo directamente.

Saludos
Adjuntos
hello_world.zip
(160.12 KiB) Descargado 340 veces

Responder

Volver a “Cores”