Line 1... |
Line 1... |
-------------------------------------------------------------------------------------------------100
|
-------------------------------------------------------------------------------------------------100
|
--| Modular Oscilloscope
|
--| Modular Oscilloscope
|
--| UNSL - Argentine
|
--| UNSL - Argentine
|
--|
|
--|
|
--| File: data_skipper.vhd
|
--| File: ctrl_data_skipper.vhd
|
--| Version: 0.1
|
--| Version: 0.12
|
--| Tested in: Actel A3PE1500
|
--| Tested in: Actel A3PE1500
|
|
--| Board: RVI Prototype Board + LP Data Conversion Daughter Board
|
--|-------------------------------------------------------------------------------------------------
|
--|-------------------------------------------------------------------------------------------------
|
--| Description:
|
--| Description:
|
--| CONTROL - Data skipper
|
--| CONTROL - Data skipper
|
--| It generates an enable signal for write acquisitions in memory.
|
--| It generates an enable signal for write acquisitions in memory.
|
--|
|
--|
|
--|-------------------------------------------------------------------------------------------------
|
--|-------------------------------------------------------------------------------------------------
|
--| File history:
|
--| File history:
|
--| 0.1 | jul-2009 | First testing
|
--| 0.1 | jul-2009 | First testing
|
|
--| 0.11 | jul-2009 | Added input signal indicating when it's selected the first channel
|
|
--| 0.12 | jul-2009 | Optimized
|
----------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------
|
--| Copyright © 2009, Facundo Aguilera.
|
--| Copyright © 2009, Facundo Aguilera.
|
--|
|
--|
|
--| This VHDL design file is an open design; you can redistribute it and/or
|
--| This VHDL design file is an open design; you can redistribute it and/or
|
--| modify it and/or implement it after contacting the author.
|
--| modify it and/or implement it after contacting the author.
|
Line 38... |
Line 41... |
use work.ctrl_pkg.all;
|
use work.ctrl_pkg.all;
|
|
|
|
|
----------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------
|
entity data_skipper is
|
entity ctrl_data_skipper is
|
generic(
|
generic(
|
-- max losses = 2**(2**SELECTOR_WIDTH). (i.e., if SELECTOR_WIDTH = 5: 4.2950e+09)
|
-- max losses = 2**(2**SELECTOR_WIDTH). (i.e., if SELECTOR_WIDTH = 5: 4.2950e+09)
|
SELECTOR_WIDTH: integer := 5
|
SELECTOR_WIDTH: integer := 5
|
);
|
);
|
port(
|
port(
|
Line 53... |
Line 56... |
-- selector from register, equation: losses = 2**(selector_I + 1) * enable_skipper_I
|
-- selector from register, equation: losses = 2**(selector_I + 1) * enable_skipper_I
|
selector_I: in std_logic_vector(SELECTOR_WIDTH-1 downto 0);
|
selector_I: in std_logic_vector(SELECTOR_WIDTH-1 downto 0);
|
-- enable from register
|
-- enable from register
|
enable_skipper_I: in std_logic;
|
enable_skipper_I: in std_logic;
|
-- common signals
|
-- common signals
|
reset_I, clk_I: in std_logic
|
reset_I, clk_I: in std_logic;
|
|
|
|
first_channel_I: in std_logic
|
);
|
);
|
end entity data_skipper;
|
end ctrl_entity data_skipper;
|
|
|
|
|
----------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------
|
architecture ARCH10 of data_skipper is
|
architecture ARCH10 of ctrl_data_skipper is
|
signal count: std_logic_vector( integer(2**real(SELECTOR_WIDTH))-1 downto 0);
|
signal count: std_logic_vector( integer(2**real(SELECTOR_WIDTH))-1 downto 0);
|
signal decoded: std_logic_vector( integer(2**real(SELECTOR_WIDTH))-1 downto 0);
|
signal decoded: std_logic_vector( integer(2**real(SELECTOR_WIDTH))-1 downto 0);
|
|
signal anded: std_logic_vector( integer(2**real(SELECTOR_WIDTH))-1 downto 0);
|
signal reset_count: std_logic;
|
signal reset_count: std_logic;
|
signal match: std_logic;
|
signal match: std_logic;
|
signal enable_count: std_logic;
|
signal enable_count: std_logic;
|
|
|
begin
|
begin
|
|
|
U_COUNTER0: generic_counter
|
U_COUNTER0: generic_counter
|
generic map(
|
generic map(
|
OUTPUT_WIDTH => integer(2**real(SELECTOR_WIDTH)) -- Output width for counter.
|
OUTPUT_WIDTH => integer(2**real(SELECTOR_WIDTH)) -- Output width for counter.
|
Line 89... |
Line 96... |
enable_I => enable_skipper_I,
|
enable_I => enable_skipper_I,
|
data_I => selector_I,
|
data_I => selector_I,
|
decoded_O => decoded
|
decoded_O => decoded
|
);
|
);
|
|
|
|
anded <= decoded and count;
|
match <= '1' when decoded <= count else
|
match <= '1' when anded = std_logic_vector(to_unsigned(0,integer(2**real(SELECTOR_WIDTH)))) else
|
'0' ;
|
'0' ;
|
reset_count <= match or reset_I;
|
|
enable_count <= stb_I and ack_I and enable_skipper_I;
|
reset_count <= reset_I;
|
|
enable_count <= stb_I and ack_I and enable_skipper_I and first_channel_I;
|
|
|
ack_O <= stb_I and ack_I and (match or not(enable_skipper_I)) and not(reset_I);
|
ack_O <= stb_I and ack_I and (match or not(enable_skipper_I)) and not(reset_I);
|
|
|
end architecture;
|
end architecture;
|
No newline at end of file
|
No newline at end of file
|