DHBKM1024I-8 hmb_fpga_top now uses autogenerated code for register file. Added dhb_fpga_top.cdf and .cof

This commit is contained in:
Christos Spirotis 2020-07-08 10:58:01 +01:00
commit bbf610f642
12 changed files with 251 additions and 87 deletions

View file

@ -0,0 +1,13 @@
/* Quartus Prime Version 19.1.0 Build 670 09/22/2019 SJ Lite Edition */
JedecChain;
FileRevision(JESD32A);
DefaultMfr(6E);
P ActionCode(Cfg)
Device PartName(10CL006Y) Path("") File("") MfrSpec(OpMask(1) SEC_Device(MT25QL128) Child_OpMask(1 1));
ChainEnd;
AlteraBegin;
ChainType(JTAG);
AlteraEnd;

View file

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="US-ASCII" standalone="yes"?>
<cof>
<eprom_name>MT25QL128</eprom_name>
<flash_loader_device>10CL006Y</flash_loader_device>
<output_filename>dhb_fpga_top.jic</output_filename>
<n_pages>1</n_pages>
<width>1</width>
<mode>7</mode>
<sof_data>
<user_name>Page_0</user_name>
<page_flags>1</page_flags>
<bit0>
<sof_filename>./output_files/dhb_fpga_top.sof</sof_filename>
</bit0>
</sof_data>
<version>10</version>
<create_cvp_file>0</create_cvp_file>
<create_hps_iocsr>0</create_hps_iocsr>
<auto_create_rpd>0</auto_create_rpd>
<rpd_little_endian>1</rpd_little_endian>
<options>
<map_file>1</map_file>
</options>
<advanced_options>
<ignore_epcs_id_check>1</ignore_epcs_id_check>
<ignore_condone_check>2</ignore_condone_check>
<plc_adjustment>0</plc_adjustment>
<post_chain_bitstream_pad_bytes>-1</post_chain_bitstream_pad_bytes>
<post_device_bitstream_pad_bytes>-1</post_device_bitstream_pad_bytes>
<bitslice_pre_padding>1</bitslice_pre_padding>
</advanced_options>
</cof>

View file

@ -123,21 +123,25 @@ set_location_assignment PIN_G15 -to led_green
set_location_assignment PIN_K10 -to shutdown
set_location_assignment PIN_F16 -to wd_to
set_instance_assignment -name CURRENT_STRENGTH_NEW 8MA -to fpga_dout[*]
set_instance_assignment -name CURRENT_STRENGTH_NEW 8MA -to led[*]
set_instance_assignment -name CURRENT_STRENGTH_NEW 8MA -to led_green
set_instance_assignment -name CURRENT_STRENGTH_NEW 8MA -to shutdown
set_instance_assignment -name CURRENT_STRENGTH_NEW 8MA -to wd_to
set_instance_assignment -name CURRENT_STRENGTH_NEW 8MA -to fpga_scl
set_instance_assignment -name CURRENT_STRENGTH_NEW 8MA -to fpga_sda
set_instance_assignment -name CURRENT_STRENGTH_NEW 8MA -to shdn_v_hb_stby
set_instance_assignment -name CURRENT_STRENGTH_NEW 8MA -to hb_en[*]
set_global_assignment -name VERILOG_FILE ../src/simple_i2c_slave.v
set_global_assignment -name VHDL_FILE ../src/hmb_fpga_top.vhd
set_global_assignment -name VHDL_FILE ip/pll_25in_100out.vhd
set_global_assignment -name VHDL_FILE ip/io_buf_i2c.vhd
set_global_assignment -name EDA_GENERATE_FUNCTIONAL_NETLIST ON -section_id eda_simulation
set_global_assignment -name VHDL_INPUT_VERSION VHDL_2008
set_global_assignment -name VHDL_SHOW_LMF_MAPPING_MESSAGES OFF
set_global_assignment -name CYCLONEII_RESERVE_NCEO_AFTER_CONFIGURATION "USE AS REGULAR IO"
set_global_assignment -name VHDL_FILE ../src/hmb_fpga_pkg_auto.vhd
set_global_assignment -name VHDL_FILE ../src/hmb_fpga_csr_regs_auto.vhd
set_global_assignment -name VHDL_FILE ../src/hmb_fpga_csr_decode_auto.vhd
set_global_assignment -name VERILOG_FILE ../src/simple_i2c_slave.v
set_global_assignment -name VHDL_FILE ../src/hmb_fpga_top.vhd
set_global_assignment -name VHDL_FILE ip/pll_25in_100out.vhd
set_global_assignment -name VHDL_FILE ip/io_buf_i2c.vhd
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top

View file

@ -69,8 +69,8 @@ set_input_delay -min 0.0 -clock virtual_ext_clk_1MHz [get_ports {hb_trip* hb
# Set Output Delay
#**************************************************************
set_output_delay -max 100.0 -clock virtual_ext_clk_1MHz [get_ports {shdn_v_hb_stby hb_en* shutdown led* wd_to fpga_sda fpga_scl}]
set_output_delay -min 0.0 -clock virtual_ext_clk_1MHz [get_ports {shdn_v_hb_stby hb_en* shutdown led* wd_to fpga_sda fpga_scl}]
set_output_delay -max 100.0 -clock virtual_ext_clk_1MHz [get_ports {shdn_v_hb_stby hb_en[*] shutdown led* wd_to fpga_sda fpga_scl}]
set_output_delay -min 0.0 -clock virtual_ext_clk_1MHz [get_ports {shdn_v_hb_stby hb_en[*] shutdown led* wd_to fpga_sda fpga_scl}]
#**************************************************************
# Set Clock Groups

View file

@ -1,8 +1,16 @@
[{
"ip_name" : "hmb_fpga",
"bus" : "csr",
"addr_width" : "16",
"description" : "This block the top level HMB FPGA",
"addr_hi_bit" : "9",
"addr_lo_bit" : "5",
"sub_blocks" : {
"local" : {
"instance" : "",
"process" : "hdl, cpp, txt",
"offset" : "0x000"
}
},
"registers" : {
"scratch0" : {
"address" : "0",
@ -37,8 +45,57 @@
}
}
},
"shutdown_master" : {
"address" : "3",
"width" : "1",
"type" : "r",
"reset" : "0",
"description" : "Master shutdown output status"
},
"shutdn_en0" : {
"address" : "4",
"width" : "8",
"type" : "w",
"reset" : "0",
"description" : "Shutdown new trip enables for channels 0 to 7"
},
"shutdn_en1" : {
"address" : "5",
"width" : "4",
"type" : "w",
"reset" : "0",
"description" : "Shutdown new trip enables for channels 8 to 11"
},
"shutdn_dly_lo" : {
"address" : "6",
"width" : "8",
"type" : "w",
"reset" : "0",
"description" : "Shutdown enable delay LSB in units of clock ticks (nominally 10ns)"
},
"shutdn_dly_mid" : {
"address" : "7",
"width" : "8",
"type" : "w",
"reset" : "0",
"description" : "Shutdown enable delay mid byte in units of clock ticks (nominally 10ns)"
},
"shutdn_dly_hi" : {
"address" : "8",
"width" : "8",
"type" : "w",
"reset" : "0",
"description" : "Shutdown enable delay MSB in units of clock ticks (nominally 10ns)"
},
"shutdn_go" : {
"address" : "9",
"width" : "1",
"type" : "w0",
"reset" : "0",
"description" : "Shutdown trip go control"
},
"wd_ctrl" : {
"address" : "16",
"address" : "10",
"width" : "6",
"description" : "Watchdog Control",
"fields": {
@ -64,11 +121,53 @@
}
},
"wd_status" : {
"address" : "17",
"address" : "11",
"width" : "1",
"type" : "r",
"reset" : "0",
"description" : "Watchdog fire alarm status"
},
"shutdn_clr0" : {
"address" : "12",
"width" : "8",
"type" : "w0",
"reset" : "0",
"description" : "Shutdown enable clear control for channels 0 to 7. Writing a 1 clears the relevant shutdown enable."
},
"shutdn_clr1" : {
"address" : "13",
"width" : "4",
"type" : "w0",
"reset" : "0",
"description" : "Shutdown enable clear control for channels 8 to 11. Writing a 1 clears the relevant shutdown enable."
},
"trip_clr0" : {
"address" : "14",
"width" : "8",
"type" : "w0",
"reset" : "0",
"description" : "Shutdown trip clear control for channels 0 to 7. Writing a 1 clears the relevant shutdown status."
},
"trip_clr1" : {
"address" : "15",
"width" : "4",
"type" : "w0",
"reset" : "0",
"description" : "Shutdown trip clear control for channels 8 to 11. Writing a 1 clears the relevant shutdown status."
},
"shutdn_status0" : {
"address" : "16",
"width" : "8",
"type" : "r",
"reset" : "0",
"description" : "Shutdown statuses clear control for channels 0 to 7"
},
"shutdn_status1" : {
"address" : "17",
"width" : "4",
"type" : "r",
"reset" : "0",
"description" : "Shutdown statuses clear control for channels 8 to 11"
}
}
}]

View file

@ -112,11 +112,15 @@ architecture struct of hmb_fpga_top is
signal scl_out : std_logic;
signal sda_in : std_logic;
signal sda_out : std_logic;
signal address : std_logic_vector(15 downto 0);
signal wr_data : std_logic_vector(7 downto 0);
signal rd_data : std_logic_vector(7 downto 0);
signal wr_en : std_logic := '0';
signal rd_en : std_logic := '0';
signal avs_csr_address : std_logic_vector(15 downto 0);
signal avs_csr_writedata : std_logic_vector(31 downto 0) := (others => '0');
signal avs_csr_readdata : std_logic_vector(31 downto 0) := (others => '0');
signal avs_csr_write : std_logic := '0';
signal avs_csr_read : std_logic := '0';
signal local_readdata : std_logic_vector(31 downto 0);
signal local_read : std_logic;
signal local_write : std_logic;
signal rd_dv : std_logic := '0';
-- Shutdown signals
@ -143,6 +147,7 @@ architecture struct of hmb_fpga_top is
signal en_wd : std_logic := '0';
signal wd_period : std_logic_vector(3 downto 0) := 4x"A"; -- 1 second (10 * 100ms)
signal cmp_count : std_logic_vector(3 downto 0);
signal rst_n : std_logic := '0';
begin
@ -218,28 +223,27 @@ begin
process (clk100)
begin
if rising_edge(clk100) then
-- Read data is valid the cycle after rd_en is asserted
rd_dv <= rd_en;
-- Read data is valid the cycle after avs_csr_read is asserted
rd_dv <= avs_csr_read;
end if;
end process;
simple_i2c_slave_inst : simple_i2c_slave
port map (
clk => clk100,
scl_in => scl_in,
scl_out => scl_out,
sda_in => sda_in,
sda_out => sda_out,
i2c_busy_out => open,
add_out => address,
wr_data_out => wr_data,
wr_en_out => wr_en,
rd_en_out => rd_en,
rd_data_in => rd_data,
rd_dv_in => rd_dv
clk => clk100,
scl_in => scl_in,
scl_out => scl_out,
sda_in => sda_in,
sda_out => sda_out,
i2c_busy_out => open,
add_out => avs_csr_address,
wr_data_out => avs_csr_writedata(7 downto 0),
wr_en_out => avs_csr_write,
rd_en_out => avs_csr_read,
rd_data_in => avs_csr_readdata(7 downto 0),
rd_dv_in => rd_dv
);
-- Instantiate I2C I/O cells
i2c_scl_io_inst : entity work.io_buf_i2c
port map (
datain(0) => scl_out,
@ -281,6 +285,10 @@ begin
wd_alarm <= '1';
end if;
if rst_n = '0' and unsigned(us_count) > 100 then
rst_n <= '1';
end if;
-- If watchdog enabled and no shut down, count the time
if en_wd = '1' and shutdown_out = '0' then
@ -319,65 +327,68 @@ begin
-- Create registers (non-monitor) and address decoding
------------------------------------------------------------------------------
PROC_REGS : process (clk100)
begin
if rising_edge(clk100) then
hmb_fpga_csr_decode_inst : entity work.hmb_fpga_csr_decode
generic map (
ADDR_DECODE_HI_BIT => 9,
ADDR_DECODE_LO_BIT => 5
)
port map (
-- Default register values
clr_wd <= '0';
rd_data <= 8x"0";
-- Write registers
if wr_en = '1' then
case address is
when I2C_ADDR_SCRATCH0 => scratch0 <= wr_data(7 downto 0);
when I2C_ADDR_SCRATCH1 => scratch1 <= wr_data(7 downto 0);
when I2C_ADDR_DBG_LED => cpu_led <= wr_data(5 downto 0);
when I2C_ADDR_WD_CTRL => clr_wd <= wr_data(0);
en_wd <= wr_data(1);
wd_period <= wr_data(5 downto 2);
when I2C_SHUTDN_CTRL => shutdn_go <= wr_data(0);
when I2C_SHUTDN1_EN_CLR => shutdn_clr( 7 downto 0) <= wr_data(7 downto 0);
when I2C_SHUTDN2_EN_CLR => shutdn_clr(11 downto 8) <= wr_data(3 downto 0);
when I2C_SHUTDN1_TR_CLR => trip_clr( 7 downto 0) <= wr_data(7 downto 0);
when I2C_SHUTDN2_TR_CLR => trip_clr(11 downto 8) <= wr_data(3 downto 0);
when I2C_SHUTDN1_EN => shutdn_trip_en_new( 7 downto 0) <= wr_data(7 downto 0);
when I2C_SHUTDN2_EN => shutdn_trip_en_new(11 downto 8) <= wr_data(3 downto 0);
when I2C_SHUTDNLO_DLY => shutdn_dly( 7 downto 0) <= wr_data(7 downto 0);
when I2C_SHUTDNMID_DLY => shutdn_dly(15 downto 8) <= wr_data(7 downto 0);
when I2C_SHUTDNHI_DLY => shutdn_dly(23 downto 16) <= wr_data(7 downto 0);
when others => null;
end case;
end if;
local_write => local_write,
local_read => local_read,
local_readdata => local_readdata,
-- Read registers
case? address is
when I2C_ADDR_SCRATCH0 => rd_data(7 downto 0) <= scratch0;
when I2C_ADDR_SCRATCH1 => rd_data(7 downto 0) <= scratch1;
when I2C_ADDR_DBG_LED => rd_data(5 downto 0) <= cpu_led;
when I2C_ADDR_WD_CTRL => rd_data(5 downto 0) <= wd_period & en_wd & clr_wd;
when I2C_ADDR_WD_STATUS => rd_data(0) <= wd_alarm;
when I2C_SHUTDN_CTRL => rd_data(0) <= shutdn_go;
when I2C_SHUTDN_STATUS => rd_data(0) <= shutdown_out;
when I2C_SHUTDN1_TR_ST => rd_data(7 downto 0) <= shutdown_int( 7 downto 0);
when I2C_SHUTDN2_TR_ST => rd_data(3 downto 0) <= shutdown_int(11 downto 8);
when I2C_SHUTDN1_EN_CLR => rd_data(7 downto 0) <= shutdn_clr( 7 downto 0);
when I2C_SHUTDN2_EN_CLR => rd_data(3 downto 0) <= shutdn_clr(11 downto 8);
when I2C_SHUTDN1_TR_CLR => rd_data(7 downto 0) <= trip_clr( 7 downto 0);
when I2C_SHUTDN2_TR_CLR => rd_data(3 downto 0) <= trip_clr(11 downto 8);
when I2C_SHUTDN1_EN => rd_data(7 downto 0) <= shutdn_trip_en_new( 7 downto 0);
when I2C_SHUTDN2_EN => rd_data(3 downto 0) <= shutdn_trip_en_new(11 downto 8);
when I2C_SHUTDNLO_DLY => rd_data(7 downto 0) <= shutdn_dly( 7 downto 0);
when I2C_SHUTDNMID_DLY => rd_data(7 downto 0) <= shutdn_dly(15 downto 8);
when I2C_SHUTDNHI_DLY => rd_data(7 downto 0) <= shutdn_dly(23 downto 16);
avs_address => avs_csr_address(9 downto 5),
avs_write => avs_csr_write,
avs_read => avs_csr_read,
avs_readdata => avs_csr_readdata
when others => rd_data(0) <= '0';
end case?;
end if;
);
end process;
hmb_fpga_csr_regs_inst : entity work.hmb_fpga_csr_regs
generic map(
ADDR_DECODE_WIDTH => 5
)
port map(
-- Clock and reset
clk => clk100,
rst_n => rst_n,
scratch0 => scratch0,
scratch1 => open,
cpu_dbg_led_en => cpu_led(0),
cpu_dbg_led_val => cpu_led(5 downto 1),
shutdn_en0 => shutdn_trip_en_new(7 downto 0),
shutdn_en1 => shutdn_trip_en_new(11 downto 8),
shutdn_go => shutdn_go,
shutdn_dly_lo => shutdn_dly(7 downto 0),
shutdn_dly_mid => shutdn_dly(15 downto 8),
shutdn_dly_hi => shutdn_dly(23 downto 16),
shutdn_clr0 => shutdn_clr( 7 downto 0),
shutdn_clr1 => shutdn_clr(11 downto 8),
trip_clr0 => trip_clr( 7 downto 0),
trip_clr1 => trip_clr(11 downto 8),
shutdn_status0 => shutdown_int( 7 downto 0),
shutdn_status1 => shutdown_int(11 downto 8),
wd_ctrl_en => en_wd,
wd_ctrl_period => wd_period,
wd_ctrl_clr => clr_wd,
shutdown_master => shutdown_out,
wd_status => wd_alarm,
avs_address => avs_csr_address(4 downto 0),
avs_write => local_write,
avs_writedata => avs_csr_writedata,
avs_read => local_read,
avs_readdata => local_readdata
);
------------------------------------------------------------------------------
-- Shutdown delay
------------------------------------------------------------------------------

View file

@ -1,4 +1,4 @@
@REM Directories
@REM Directories
@set FWTOOLSDIR=..\..\..\..\..\fw_development_tools\logic_memory_mapper
@set LIBDOCDIR=..\..\..\..\..\fw_development_tools\verification\lib\hdl\doc
@set REPODIR=..\..\..\..
@ -15,8 +15,12 @@
@py -3 %FWTOOLSDIR%\gen_elhal.py -j %LIBDOCDIR%\fpga.json -b csr -o .\src\hal
@py -3 %FWTOOLSDIR%\gen_elhal.py -r ..\..\..\.. -b csr -o .\src\hal
@py -3 %FWTOOLSDIR%\gen_htm.py -j ..\..\..\hmb_fpga_top\doc\hmb_fpga.json -b csr
@py -3 %FWTOOLSDIR%\gen_elhal.py -j ..\..\..\hmb_fpga_top\doc\hmb_fpga.json -b csr -o .\src\hal
@py -3 %FWTOOLSDIR%\gen_hdl.py -j ..\..\..\hmb_fpga_top\doc\hmb_fpga.json -b csr -s _auto
@REM Add project specific build here. Normally just point to top of the repository for hierarchical scan
@py -3 %FWTOOLSDIR%\gen_hdl.py -r %REPODIR% -b csr seq avalon_slave_0 -s _auto
@py -3 %FWTOOLSDIR%\gen_htm.py -r %REPODIR% -b csr seq -B
@py -3 %FWTOOLSDIR%\gen_json.py -r %REPODIR% -b csr seq -s _auto -o %REPODIR%\firmware\top\doc
@py -3 %FWTOOLSDIR%\gen_json.py -r %REPODIR% -b csr seq -s _auto -o %REPODIR%\firmware\top\doc

View file

@ -58,6 +58,7 @@ JSONFILES = doc/*.json \
../../../print_streamer/doc/*.json \
../../../print_unit/doc/*.json \
../../../top/doc/core.json \
../../../hmb_fpga_top/doc/*.json \
${LIBDOCDIR}/*.json \
${ELGIPDIRLOCAL}/shutdown_monitor/0/doc/*.json \
${ELGIPDIRLOCAL}/enc_pd_emul/1/doc/*.json \