Skip to content

Commit

Permalink
vga: instantiate PLL from VHDL
Browse files Browse the repository at this point in the history
  • Loading branch information
umarcor committed Oct 17, 2020
1 parent 1eba45f commit 355dcc1
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 54 deletions.
2 changes: 1 addition & 1 deletion vga/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ vgatest.json: $(VHDL_SYN_FILES) $(VERILOG_SYN_FILES)
"$(GHDL_SYNTH) $(GHDL_FLAGS) $(VHDL_SYN_FILES) -e; \
$(YOSYS_SYNTH) \
-top $(BOARD_TOP) \
-json $@" 2>&1 board/pll.v | tee yosys-report.txt
-json $@" 2>&1 | tee yosys-report.txt

vgatest.asc: vgatest.json
$(NEXTPNR) \
Expand Down
8 changes: 5 additions & 3 deletions vga/board/icestick/Icestick_Top.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,16 @@ architecture arch of Icestick_Top is

begin

PLL_0: PLL
PLL_0: SB_PLL40_CORE
generic map (
DIVF => to_unsigned( PLL_cfg.DIVF, 7),
DIVQ => to_unsigned( PLL_cfg.DIVQ, 3)
)
port map (
clki => CLK,
clko => clki
REFERENCECLK => CLK,
PLLOUTCORE => clki,
BYPASS => '0',
RESETB => '1'
);

UUT: entity work.Design_Top(pattern)
Expand Down
24 changes: 0 additions & 24 deletions vga/board/pll.v

This file was deleted.

8 changes: 5 additions & 3 deletions vga/board/tinyfpgabx/TinyFPGABX_Top.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,16 @@ begin
-- Drive USB pull-up resistor to '0' to disable USB
USBPU <= '0';

PLL_0: PLL
PLL_0: SB_PLL40_CORE
generic map (
DIVF => to_unsigned( PLL_cfg.DIVF, 7),
DIVQ => to_unsigned( PLL_cfg.DIVQ, 3)
)
port map (
clki => CLK,
clko => clki
REFERENCECLK => CLK,
PLLOUTCORE => clki,
BYPASS => '0',
RESETB => '1'
);

UUT: entity work.Design_Top(pattern)
Expand Down
46 changes: 23 additions & 23 deletions vga/device/ICE40/ICE40_components_pkg.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -14,45 +14,45 @@ component PLL
);
end component;

--component SB_PLL40_CORE
-- generic (
-- --- Feedback
-- FEEDBACK_PATH : string := "SIMPLE"; -- String (simple, delay, phase_and_delay, external)
component SB_PLL40_CORE
generic (
--- Feedback
FEEDBACK_PATH : string := "SIMPLE"; -- String (simple, delay, phase_and_delay, external)
-- DELAY_ADJUSTMENT_MODE_FEEDBACK : string := "FIXED";
-- DELAY_ADJUSTMENT_MODE_RELATIVE : string := "FIXED";
-- SHIFTREG_DIV_MODE : bit_vector(1 downto 0) := "00"; -- 0-->Divide by 4, 1-->Divide by 7, 3 -->Divide by 5
-- FDA_FEEDBACK : bit_vector(3 downto 0) := "0000"; -- Integer (0-15)
-- FDA_RELATIVE : bit_vector(3 downto 0) := "0000"; -- Integer (0-15)
-- PLLOUT_SELECT : string := "GENCLK";
--
PLLOUT_SELECT : string := "GENCLK";

-- --- Use the spread sheet to populate the values below
-- DIVF : bit_vector(6 downto 0); -- Determine a good default value
-- DIVR : bit_vector(3 downto 0); -- Determine a good default value
-- DIVQ : bit_vector(2 downto 0); -- Determine a good default value
-- FILTER_RANGE : bit_vector(2 downto 0); -- Determine a good default value
--
-- --- Additional C-Bits
DIVF : unsigned(6 downto 0); -- Determine a good default value
DIVR : unsigned(3 downto 0) := (others=>'0'); -- Determine a good default value
DIVQ : unsigned(2 downto 0); -- Determine a good default value
FILTER_RANGE : unsigned(2 downto 0) := "001" -- Determine a good default value

--- Additional C-Bits
-- ENABLE_ICEGATE : bit := '0';
--
-- --- Test Mode Parameter

--- Test Mode Parameter
-- TEST_MODE : bit := '0';
-- EXTERNAL_DIVIDE_FACTOR : integer := 1 -- Not Used by model, Added for PLL config GUI
-- );
-- port (
-- REFERENCECLK : in std_logic; -- Driven by core logic
-- PLLOUTCORE : out std_logic; -- PLL output to core logic
);
port (
REFERENCECLK : in std_logic; -- Driven by core logic
PLLOUTCORE : out std_logic; -- PLL output to core logic
-- PLLOUTGLOBAL : out std_logic; -- PLL output to global network
-- EXTFEEDBACK : in std_logic; -- Driven by core logic
-- DYNAMICDELAY : in std_logic_vector (7 downto 0); -- Driven by core logic
-- LOCK : out std_logic; -- Output of PLL
-- BYPASS : in std_logic; -- Driven by core logic
-- RESETB : in std_logic; -- Driven by core logic
BYPASS : in std_logic; -- Driven by core logic
RESETB : in std_logic -- Driven by core logic
-- LATCHINPUTVALUE : in std_logic; -- iCEGate Signal
-- -- Test Pins
-- Test Pins
-- SDO : out std_logic; -- Output of PLL
-- SDI : in std_logic; -- Driven by core logic
-- SCLK : in std_logic -- Driven by core logic
-- );
--end component;
);
end component;

end ICE40_components;

0 comments on commit 355dcc1

Please sign in to comment.