New project structure
Rewrite of all functions Signed-off-by: Jojojoppe <joppe@blondel.nl>
This commit is contained in:
2
examples/spartan6/.gitignore
vendored
2
examples/spartan6/.gitignore
vendored
@ -1,2 +0,0 @@
|
||||
OUT
|
||||
.build
|
@ -1,41 +0,0 @@
|
||||
NET "ACLK" LOC = P126;
|
||||
NET "ACLK" TNM_NET = "SYS_CLK_PIN";
|
||||
TIMESPEC TS_SYS_CLK_PIN = PERIOD "SYS_CLK_PIN" 10 ns HIGH 50 %;
|
||||
|
||||
NET "LED[0]" LOC = P119;
|
||||
NET "LED[0]" IOSTANDARD = LVCMOS33;
|
||||
NET "LED[0]" DRIVE = 8;
|
||||
NET "LED[1]" LOC = P118;
|
||||
NET "LED[1]" IOSTANDARD = LVCMOS33;
|
||||
NET "LED[1]" DRIVE = 8;
|
||||
NET "LED[2]" LOC = P117;
|
||||
NET "LED[2]" IOSTANDARD = LVCMOS33;
|
||||
NET "LED[2]" DRIVE = 8;
|
||||
NET "LED[3]" LOC = P116;
|
||||
NET "LED[3]" IOSTANDARD = LVCMOS33;
|
||||
NET "LED[3]" DRIVE = 8;
|
||||
NET "LED[4]" LOC = P115;
|
||||
NET "LED[4]" IOSTANDARD = LVCMOS33;
|
||||
NET "LED[4]" DRIVE = 8;
|
||||
NET "LED[5]" LOC = P114;
|
||||
NET "LED[5]" IOSTANDARD = LVCMOS33;
|
||||
NET "LED[5]" DRIVE = 8;
|
||||
NET "LED[6]" LOC = P112;
|
||||
NET "LED[6]" IOSTANDARD = LVCMOS33;
|
||||
NET "LED[6]" DRIVE = 8;
|
||||
NET "LED[7]" LOC = P111;
|
||||
NET "LED[7]" IOSTANDARD = LVCMOS33;
|
||||
NET "LED[7]" DRIVE = 8;
|
||||
|
||||
NET "SW[0]" LOC = P124;
|
||||
NET "SW[0]" IOSTANDARD = LVCMOS33;
|
||||
NET "SW[0]" PULLUP;
|
||||
NET "SW[1]" LOC = P123;
|
||||
NET "SW[1]" IOSTANDARD = LVCMOS33;
|
||||
NET "SW[1]" PULLUP;
|
||||
NET "SW[2]" LOC = P121;
|
||||
NET "SW[2]" IOSTANDARD = LVCMOS33;
|
||||
NET "SW[2]" PULLUP;
|
||||
NET "SW[3]" LOC = P120;
|
||||
NET "SW[3]" IOSTANDARD = LVCMOS33;
|
||||
NET "SW[3]" PULLUP;
|
@ -1,6 +0,0 @@
|
||||
# Spartan 6 example
|
||||
|
||||
Create IP files: `remotesyn -l ip total`<br>
|
||||
Run full toolchain: `remotesyn -l all total`<br>
|
||||
Run simulation: `remotesyn -l sim presim_total`<br>
|
||||
Run post-simulation (after synthesis and implementation): `remotesyn -l sim postsim_total`<br>
|
@ -1,28 +0,0 @@
|
||||
library IEEE;
|
||||
use IEEE.STD_LOGIC_1164.all;
|
||||
use IEEE.NUMERIC_STD.all;
|
||||
|
||||
entity toplevel is
|
||||
port (
|
||||
ACLK : in std_logic;
|
||||
LED : out std_logic_vector(7 downto 0);
|
||||
SW : in std_logic_vector(3 downto 0)
|
||||
);
|
||||
end toplevel;
|
||||
|
||||
architecture structural of toplevel is
|
||||
signal ARESETN : std_logic;
|
||||
begin
|
||||
|
||||
ARESETN <= SW(3);
|
||||
|
||||
process(ACLK, ARESETN)
|
||||
begin
|
||||
if ARESETN='0' then
|
||||
LED <= "11111111";
|
||||
elsif rising_edge(ACLK) then
|
||||
LED <= SW & SW;
|
||||
end if;
|
||||
end process;
|
||||
|
||||
end architecture;
|
@ -1,49 +0,0 @@
|
||||
library IEEE;
|
||||
use IEEE.STD_LOGIC_1164.all;
|
||||
use IEEE.NUMERIC_STD.all;
|
||||
|
||||
entity tb_toplevel is
|
||||
end entity;
|
||||
|
||||
architecture behavioural of tb_toplevel is
|
||||
|
||||
-- COMPONENTS
|
||||
-- ----------
|
||||
component toplevel is
|
||||
port (
|
||||
ACLK : in std_logic;
|
||||
LED : out std_logic_vector(7 downto 0);
|
||||
SW : in std_logic_vector(3 downto 0)
|
||||
);
|
||||
end component;
|
||||
|
||||
-- SIGNALS
|
||||
-- -------
|
||||
signal ACLK : std_logic := '0';
|
||||
signal LED : std_logic_vector(7 downto 0) := "00000000";
|
||||
signal SW : std_logic_vector(3 downto 0) := "0111";
|
||||
|
||||
begin
|
||||
|
||||
c_toplevel : component toplevel port map(
|
||||
ACLK, LED, SW
|
||||
);
|
||||
|
||||
ACLK <= not ACLK after 10 ns;
|
||||
SW(3) <= '1' after 150 ns;
|
||||
|
||||
process
|
||||
begin
|
||||
wait until SW(3)='1';
|
||||
|
||||
SW(2 downto 0) <= "101";
|
||||
wait for 75 ns;
|
||||
SW(2 downto 0) <= "010";
|
||||
wait for 19 ns;
|
||||
SW(2 downto 0) <= "111";
|
||||
|
||||
wait for 100 ns;
|
||||
report "END OF SIMULATION" severity failure;
|
||||
end process;
|
||||
|
||||
end architecture;
|
@ -1,78 +0,0 @@
|
||||
# PROJECT SETTINGS
|
||||
# ----------------
|
||||
[server]
|
||||
hostname = localhost
|
||||
port = 8080
|
||||
privkey = keys/id_rsa
|
||||
pubkey = keys/id_rsa.pub
|
||||
|
||||
[project]
|
||||
# Toolchain selection. choose between [ISE, VIVADO]
|
||||
toolchain = ISE
|
||||
out_dir = OUT
|
||||
|
||||
[target]
|
||||
family = spartan6
|
||||
device = xc6slx9
|
||||
package = tqg144
|
||||
speedgrade = -2
|
||||
|
||||
# HARDWARE TARGETS
|
||||
# ----------------
|
||||
[total]
|
||||
src_vhdl = RTL/toplevel.vhd
|
||||
src_verilog =
|
||||
src_sysverilog =
|
||||
src_constraints = CON/toplevel.ucf
|
||||
src_ip = blk_mem
|
||||
toplevel = toplevel
|
||||
extra_options = xst -glob_opt max_delay -opt_mode speed
|
||||
netgen -ism
|
||||
map -ol high -xe n
|
||||
par -ol high -xe n
|
||||
trce -v 3 -s 2 -n 3 -fastpaths
|
||||
# Currently supported for ISE
|
||||
# - xst -> settings added to the xst command
|
||||
# - netgen -> settings added to the netgen command
|
||||
# - ngd -> settings added to the ngd command
|
||||
# - map -> settigs added to the map command
|
||||
# - par -> settings added to the par command
|
||||
# - bitgen -> settings added to the bitgen command
|
||||
# - trce -> settings added to the trce command
|
||||
|
||||
# SIMULATION TARGETS
|
||||
# ------------------
|
||||
[presim_total]
|
||||
simtype = presim
|
||||
src_vhdl = RTL/toplevel.vhd
|
||||
SIM/tb_toplevel.vhd
|
||||
src_verilog =
|
||||
src_sysverilog =
|
||||
toplevel = tb_toplevel
|
||||
runtime = all
|
||||
levels = 10
|
||||
|
||||
[postsim_total]
|
||||
simtype = postsim
|
||||
src_vhdl = SIM/tb_toplevel.vhd
|
||||
src_verilog = OUT/total/total.map.v
|
||||
src_sysverilog =
|
||||
src_ip =
|
||||
src_sdf = OUT/total/total.map.sdf
|
||||
toplevel = tb_toplevel
|
||||
runtime = all
|
||||
# Delay type: [min typ max]
|
||||
delay = max
|
||||
sdfroot = /tb_toplevel/c_toplevel
|
||||
levels = 10
|
||||
|
||||
# IP BLOCKS
|
||||
# ---------
|
||||
[ip_blk_mem]
|
||||
ip_blk_mem = xilinx.com:ip:blk_mem_gen:7.3
|
||||
component_name = blk_mem
|
||||
interface_type = Native
|
||||
port_a_clock = 100
|
||||
read_width_a = 32
|
||||
write_width_a = 32
|
||||
write_depth_a = 256
|
2
examples/zynq7000/.gitignore
vendored
2
examples/zynq7000/.gitignore
vendored
@ -1,2 +0,0 @@
|
||||
OUT
|
||||
.build
|
@ -1,4 +0,0 @@
|
||||
set_property IOSTANDARD LVCMOS33 [get_ports {LED[1]}]
|
||||
set_property IOSTANDARD LVCMOS33 [get_ports {LED[0]}]
|
||||
set_property PACKAGE_PIN W13 [get_ports {LED[0]}]
|
||||
set_property PACKAGE_PIN W14 [get_ports {LED[1]}]
|
@ -1,6 +0,0 @@
|
||||
# ZYNQ 7000 example
|
||||
|
||||
Create IP files: `remotesyn -l ip total`<br>
|
||||
Run full toolchain: `remotesyn -l all total`<br>
|
||||
Run simulation (first one should create IP files for the sim targets): `remotesyn -l sim presim_total`<br>
|
||||
Run post-simulation (after synthesis and implementation): `remotesyn -l sim postsim_total`<br>
|
@ -1,39 +0,0 @@
|
||||
library ieee;
|
||||
use ieee.std_logic_1164.all;
|
||||
use ieee.numeric_std.all;
|
||||
|
||||
entity heartbeat is
|
||||
generic (
|
||||
Fin : integer := 100000000;
|
||||
Fout : integer := 8
|
||||
);
|
||||
port (
|
||||
ACLK : in std_logic;
|
||||
ARESETN : in std_logic;
|
||||
LED : out std_logic_vector(1 downto 0)
|
||||
);
|
||||
end entity;
|
||||
|
||||
architecture structural of heartbeat is
|
||||
signal iLED : std_logic_vector(1 downto 0);
|
||||
begin
|
||||
|
||||
LED <= iLED;
|
||||
|
||||
process (ACLK, ARESETN)
|
||||
variable cnt : integer range 0 to Fin/(2 * Fout) - 1 := 0;
|
||||
begin
|
||||
if ARESETN = '0' then
|
||||
cnt := 0;
|
||||
iLED <= "01";
|
||||
elsif rising_edge(ACLK) then
|
||||
if (cnt = Fin/(2 * Fout) - 1) then
|
||||
cnt := 0;
|
||||
iLED <= not iLED;
|
||||
else
|
||||
cnt := cnt + 1;
|
||||
end if;
|
||||
end if;
|
||||
end process;
|
||||
|
||||
end architecture;
|
@ -1,161 +0,0 @@
|
||||
library ieee;
|
||||
use ieee.std_logic_1164.all;
|
||||
use ieee.numeric_std.all;
|
||||
|
||||
entity toplevel is
|
||||
port (
|
||||
-- DDR
|
||||
DDR_Addr : inout std_logic_vector(14 downto 0);
|
||||
DDR_BankAddr : inout std_logic_vector(2 downto 0);
|
||||
DDR_CAS_n : inout std_logic;
|
||||
DDR_Clk_n : inout std_logic;
|
||||
DDR_Clk : inout std_logic;
|
||||
DDR_CKE : inout std_logic;
|
||||
DDR_CS_n : inout std_logic;
|
||||
DDR_DM : inout std_logic_vector(3 downto 0);
|
||||
DDR_DQ : inout std_logic_vector(31 downto 0);
|
||||
DDR_DQS_n : inout std_logic_vector(3 downto 0);
|
||||
DDR_DQS_p : inout std_logic_vector(3 downto 0);
|
||||
DDR_ODT : inout std_logic;
|
||||
DDR_RAS_n : inout std_logic;
|
||||
DDR_DSTRB : inout std_logic;
|
||||
DDR_WEB : inout std_logic;
|
||||
DDR_VRN : inout std_logic;
|
||||
DDR_VRP : inout std_logic;
|
||||
|
||||
-- FIXED IO
|
||||
MIO : inout std_logic_vector(53 downto 0);
|
||||
ps_clk : inout std_logic;
|
||||
ps_porb : inout std_logic;
|
||||
ps_srstb : inout std_logic;
|
||||
|
||||
-- OWN DEFINED
|
||||
LED : out std_logic_vector(1 downto 0)
|
||||
);
|
||||
end entity;
|
||||
|
||||
architecture structural of toplevel is
|
||||
-- ----------
|
||||
-- COMPONENTS
|
||||
-- ----------
|
||||
component zynq_ps
|
||||
port (
|
||||
FCLK_CLK0 : out std_logic;
|
||||
FCLK_RESET0_N : out std_logic;
|
||||
MIO : inout std_logic_vector(53 downto 0);
|
||||
DDR_CAS_n : inout std_logic;
|
||||
DDR_CKE : inout std_logic;
|
||||
DDR_Clk_n : inout std_logic;
|
||||
DDR_Clk : inout std_logic;
|
||||
DDR_CS_n : inout std_logic;
|
||||
DDR_DRSTB : inout std_logic;
|
||||
DDR_ODT : inout std_logic;
|
||||
DDR_RAS_n : inout std_logic;
|
||||
DDR_WEB : inout std_logic;
|
||||
DDR_BankAddr : inout std_logic_vector(2 downto 0);
|
||||
DDR_Addr : inout std_logic_vector(14 downto 0);
|
||||
DDR_VRN : inout std_logic;
|
||||
DDR_VRP : inout std_logic;
|
||||
DDR_DM : inout std_logic_vector(3 downto 0);
|
||||
DDR_DQ : inout std_logic_vector(31 downto 0);
|
||||
DDR_DQS_n : inout std_logic_vector(3 downto 0);
|
||||
DDR_DQS : inout std_logic_vector(3 downto 0);
|
||||
PS_SRSTB : inout std_logic;
|
||||
PS_CLK : inout std_logic;
|
||||
PS_PORB : inout std_logic
|
||||
);
|
||||
end component;
|
||||
|
||||
component rst_gen
|
||||
port (
|
||||
slowest_sync_clk : in std_logic;
|
||||
ext_reset_in : in std_logic;
|
||||
aux_reset_in : in std_logic;
|
||||
mb_debug_sys_rst : in std_logic;
|
||||
dcm_locked : in std_logic;
|
||||
mb_reset : out std_logic;
|
||||
bus_struct_reset : out std_logic_vector(0 downto 0);
|
||||
peripheral_reset : out std_logic_vector(0 downto 0);
|
||||
interconnect_aresetn : out std_logic_vector(0 downto 0);
|
||||
peripheral_aresetn : out std_logic_vector(0 downto 0)
|
||||
);
|
||||
end component;
|
||||
|
||||
component heartbeat is
|
||||
generic (
|
||||
Fin : integer := 100000000;
|
||||
Fout : integer := 8
|
||||
);
|
||||
port (
|
||||
ACLK : in std_logic;
|
||||
ARESETN : in std_logic;
|
||||
LED : out std_logic_vector(1 downto 0)
|
||||
);
|
||||
end component;
|
||||
|
||||
-- -------
|
||||
-- SIGNALS
|
||||
-- -------
|
||||
signal FCLK_CLK0 : std_logic;
|
||||
signal FCLK_RESET0_N : std_logic;
|
||||
|
||||
signal ARESETN : std_logic_vector(0 downto 0);
|
||||
|
||||
begin
|
||||
|
||||
heartbeat_i : component heartbeat generic map(
|
||||
100000000,
|
||||
10
|
||||
) port map(
|
||||
ACLK => FCLK_CLK0,
|
||||
ARESETN => ARESETN(0),
|
||||
LED => LED
|
||||
);
|
||||
|
||||
zynq_ps_i : component zynq_ps port map(
|
||||
-- MIO
|
||||
MIO => MIO,
|
||||
|
||||
-- CLOCKS
|
||||
FCLK_CLK0 => FCLK_CLK0,
|
||||
FCLK_RESET0_N => FCLK_RESET0_N,
|
||||
|
||||
-- DDR
|
||||
DDR_CAS_n => DDR_CAS_n,
|
||||
DDR_CKE => DDR_CKE,
|
||||
DDR_Clk_n => DDR_Clk_n,
|
||||
DDR_Clk => DDR_Clk,
|
||||
DDR_CS_n => DDR_CS_n,
|
||||
DDR_DRSTB => DDR_DSTRB,
|
||||
DDR_ODT => DDR_ODT,
|
||||
DDR_RAS_n => DDR_RAS_n,
|
||||
DDR_WEB => DDR_WEB,
|
||||
DDR_BankAddr => DDR_BankAddr,
|
||||
DDR_Addr => DDR_Addr,
|
||||
DDR_VRN => DDR_VRN,
|
||||
DDR_VRP => DDR_VRP,
|
||||
DDR_DM => DDR_DM,
|
||||
DDR_DQ => DDR_DQ,
|
||||
DDR_DQS_n => DDR_DQS_n,
|
||||
DDR_DQS => DDR_DQS_p,
|
||||
|
||||
-- PS FIXED IO
|
||||
PS_SRSTB => PS_SRSTB,
|
||||
PS_CLK => PS_CLK,
|
||||
PS_PORB => PS_PORB
|
||||
);
|
||||
|
||||
rst_gen_i : rst_gen port map(
|
||||
slowest_sync_clk => FCLK_CLK0,
|
||||
ext_reset_in => FCLK_RESET0_N,
|
||||
aux_reset_in => '1',
|
||||
mb_debug_sys_rst => '0',
|
||||
dcm_locked => '1',
|
||||
--mb_reset => mb_reset,
|
||||
--bus_struct_reset => bus_struct_reset,
|
||||
--peripheral_reset => peripheral_reset,
|
||||
--interconnect_aresetn => interconnect_aresetn,
|
||||
peripheral_aresetn => ARESETN
|
||||
);
|
||||
|
||||
end architecture;
|
@ -1,36 +0,0 @@
|
||||
`timescale 1ns / 1ps
|
||||
|
||||
module tb_top ();
|
||||
|
||||
reg ACLK ;
|
||||
reg ARESETN;
|
||||
|
||||
initial begin
|
||||
ACLK = 1'b0;
|
||||
end
|
||||
|
||||
always #5 ACLK = !ACLK;
|
||||
|
||||
initial begin
|
||||
ARESETN = 1'b0;
|
||||
tb_top.ps.inst.fpga_soft_reset(32'h1);
|
||||
repeat(20)@(posedge ACLK);
|
||||
ARESETN = 1'b1;
|
||||
tb_top.ps.inst.fpga_soft_reset(32'h0);
|
||||
repeat(5)@(posedge ACLK);
|
||||
|
||||
repeat(100)@(posedge ACLK);
|
||||
// Write some data
|
||||
//tb_top.ps.inst.write_data(32'h40000000, 4, 32'hdeadbeef, resp);
|
||||
//tb_top.ps.inst.write_data(32'h40000004, 16, 128'habcdef0185274123deadbeef95123578, resp);
|
||||
|
||||
$display("End of simulation");
|
||||
$stop;
|
||||
end
|
||||
|
||||
zynq_ps ps (
|
||||
.PS_CLK (ACLK ),
|
||||
.PS_SRSTB (ARESETN ),
|
||||
.PS_PORB (ARESETN )
|
||||
);
|
||||
endmodule
|
@ -1,85 +0,0 @@
|
||||
# PROJECT SETTINGS
|
||||
# ----------------
|
||||
[server]
|
||||
hostname = localhost
|
||||
port = 8080
|
||||
privkey = keys/id_rsa
|
||||
pubkey = keys/id_rsa.pub
|
||||
|
||||
[project]
|
||||
# Toolchain selection. choose between [ISE, VIVADO]
|
||||
toolchain = VIVADO
|
||||
out_dir = OUT
|
||||
|
||||
[target]
|
||||
family = zynq
|
||||
device = xc7z010
|
||||
package = clg400
|
||||
speedgrade = -2
|
||||
|
||||
# HARDWARE TARGETS
|
||||
# ----------------
|
||||
[total]
|
||||
src_vhdl = RTL/heartbeat.vhd
|
||||
RTL/toplevel.vhd
|
||||
src_verilog =
|
||||
src_sysverilog =
|
||||
src_constraints = CON/iopins.xdc
|
||||
src_ip = zynq_ps rst_gen
|
||||
toplevel = toplevel
|
||||
extra_options = syn -flatten_hierarchy none -keep_equivalent_registers
|
||||
netlist_top toplevel
|
||||
# Currently supported for VIVADO
|
||||
# - syn -> settings added to the synth_design command
|
||||
# - netlist_top -> module used as toplevel for netlist/SDF generation
|
||||
# defaults to the toplevel setting
|
||||
|
||||
# SIMULATION TARGETS
|
||||
# ------------------
|
||||
[presim_total]
|
||||
simtype = presim
|
||||
src_vhdl = RTL/heartbeat.vhd
|
||||
RTL/toplevel.vhd
|
||||
src_verilog =
|
||||
src_sysverilog = SIM/tb_top.sv
|
||||
src_ip = zynq_ps rst_gen
|
||||
src_c =
|
||||
toplevel = tb_top
|
||||
runtime = all
|
||||
|
||||
[postsim_total]
|
||||
simtype = postsim
|
||||
src_vhdl =
|
||||
src_verilog = OUT/total/impl_netlist.v
|
||||
src_sysverilog = SIM/tb_top.sv
|
||||
src_ip =
|
||||
src_c =
|
||||
src_sdf = OUT/total/impl_netlist.sdf
|
||||
toplevel = tb_top
|
||||
runtime = all
|
||||
# Delay type: [min typ max]
|
||||
delay = max
|
||||
sdfroot = duv
|
||||
|
||||
# IP BLOCKS
|
||||
# ---------
|
||||
[ip_zynq_ps]
|
||||
ip_zynq_ps = ip:xilinx.com:processing_system7
|
||||
PCW_UIPARAM_DDR_BUS_WIDTH = 16 Bit
|
||||
PCW_UIPARAM_DDR_PARTNO = MT41K256M16 RE-125
|
||||
PCW_UART1_PERIPHERAL_ENABLE = 1
|
||||
PCW_UART1_UART1_IO = MIO 44 .. 45
|
||||
PCW_FPGA0_PERIPHERAL_FREQMHZ = 100
|
||||
PCW_USE_S_AXI_GP0 = 0
|
||||
PCW_USE_S_AXI_GP1 = 0
|
||||
PCW_USE_M_AXI_GP0 = 0
|
||||
PCW_USE_M_AXI_GP1 = 0
|
||||
PCW_USE_S_AXI_HP0 = 0
|
||||
PCW_USE_S_AXI_HP1 = 0
|
||||
PCW_USE_S_AXI_HP2 = 0
|
||||
PCW_USE_S_AXI_HP3 = 0
|
||||
|
||||
[ip_rst_gen]
|
||||
ip_rst_gen = ip:xilinx.com:proc_sys_reset
|
||||
C_EXT_RESET_HIGH = 0
|
||||
C_AUX_RESET_HIGH = 0
|
Reference in New Issue
Block a user