FlyingDutch
Advanced Member level 1
- Joined
- Dec 16, 2017
- Messages
- 458
- Helped
- 45
- Reputation
- 92
- Reaction score
- 55
- Trophy points
- 28
- Location
- Bydgoszcz - Poland
- Activity points
- 5,022
Hello,
I have some doubts regarding "programming" FPGAs in VHDL language. I know that every step in simulation is performed in so called "delta" time which is equal to zero. I would like to ask how execution of Process in normal runtime of FPGA (after configuration file has been written in FPGA flash memory) is related to main clock signal of FPGA circuit?
Let assume that I have top entity of such definition:
I had declared array of 8 indexes of std_logic_vector((7 downto 0):
and after begin of architecture implementation a I am giving values to dane_spi:
and after that I have for loop which is assigning data from defined array dane_spi to in_data signal. see process code:
My question is: when after that I define process wich has in sensitivity list in_data :
How changes (transaction of in_data) will be related to main clock cycle (input: clk_i ). I am not sure if changes will be detected at all? Could I ask more experienced coleagues for claryfing that question?
Thanks in advance and Regards
I have some doubts regarding "programming" FPGAs in VHDL language. I know that every step in simulation is performed in so called "delta" time which is equal to zero. I would like to ask how execution of Process in normal runtime of FPGA (after configuration file has been written in FPGA flash memory) is related to main clock signal of FPGA circuit?
Let assume that I have top entity of such definition:
Code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity top_spi is
Port (
clk_iT : in STD_LOGIC;
en_i_LowT : in STD_LOGIC;
data_ready_oT : out STD_LOGIC;
cs_oT : out STD_LOGIC;
sclk_oT : out STD_LOGIC;
mosi_oT : out STD_LOGIC;
miso_iT : in STD_LOGIC
);
end top_spi;
architecture Behavioral of top_spi is
component lw_spi_master is
generic (
c_clkfreq : integer := 12_000_000;
c_sclkfreq : integer := 5_000_000;
c_cpol : std_logic := '0';
c_cpha : std_logic := '0'
);
Port (
clk_i : in STD_LOGIC;
en_i_Low : in STD_LOGIC;
mosi_data_i : in STD_LOGIC_VECTOR (7 downto 0);
miso_data_o : out STD_LOGIC_VECTOR (7 downto 0);
data_ready_o : out STD_LOGIC;
cs_o : out STD_LOGIC;
sclk_o : out STD_LOGIC;
mosi_o : out STD_LOGIC;
miso_i : in STD_LOGIC
);
end component;
signal in_data : std_logic_vector (7 downto 0) := (others => '0');
signal out_data : std_logic_vector (7 downto 0) := (others => '0');
signal cnt: std_logic_vector(7 downto 0) := (others=>'0');
signal en_i_INT : std_logic := '0';
signal valid : boolean := False;
type byte_array is array (0 to 8) of std_logic_vector(7 downto 0);
signal dane_spi : byte_array;
begin
dane_spi(0)<= x"AA"; --170
dane_spi(1)<= x"FF"; --255
dane_spi(2)<= x"08"; --8
dane_spi(3)<= x"01"; --1
dane_spi(4)<= x"C2"; --194
dane_spi(5)<= x"A4"; --164
dane_spi(6)<= x"11"; --17
dane_spi(7)<= x"66"; --146
SPI_MAS : lw_spi_master
generic map(
c_clkfreq => 27_000_000,
c_sclkfreq => 5_000_000,
c_cpol => '0',
c_cpha => '0'
)
port map(
clk_i => clk_iT,
en_i_Low => en_i_LowT,
mosi_data_i => in_data,
miso_data_o => out_data,
data_ready_o => data_ready_oT,
cs_o => cs_oT,
sclk_o => sclk_oT,
mosi_o => mosi_oT,
miso_i => miso_iT
);
---------------------------------------------------
Change_data: process
begin
for I in 0 to 8 loop
in_data <= dane_spi(I);
end loop;
end process;
end Behavioral;
I had declared array of 8 indexes of std_logic_vector((7 downto 0):
Code:
type byte_array is array (0 to 8) of std_logic_vector(7 downto 0);
signal dane_spi : byte_array;
and after begin of architecture implementation a I am giving values to dane_spi:
Code:
begin
dane_spi(0)<= x"AA"; --170
dane_spi(1)<= x"FF"; --255
dane_spi(2)<= x"08"; --8
dane_spi(3)<= x"01"; --1
dane_spi(4)<= x"C2"; --194
dane_spi(5)<= x"A4"; --164
dane_spi(6)<= x"11"; --17
dane_spi(7)<= x"66"; --146
--- Updated ---
and after that I have for loop which is assigning data from defined array dane_spi to in_data signal. see process code:
Code:
Change_data: process
begin
for I in 0 to 8 loop
in_data <= dane_spi(I);
end loop;
end process;
My question is: when after that I define process wich has in sensitivity list in_data :
Code:
Check_data: process (in_data)
begin
and here some code
end process;
How changes (transaction of in_data) will be related to main clock cycle (input: clk_i ). I am not sure if changes will be detected at all? Could I ask more experienced coleagues for claryfing that question?
Thanks in advance and Regards
Last edited: