component trb_net_onewire is\r
generic(\r
USE_TEMPERATURE_READOUT : integer range 0 to 1 := 1;\r
- PARASITIC_MODE : integer range 0 to 1 := c_NO;\r
- CLK_PERIOD : integer := 10 --clk period in ns\r
+ PARASITIC_MODE : integer range 0 to 1 := c_NO;\r
+ CLK_PERIOD : integer := 10; --clk period in ns\r
+ USEINOUT : integer := c_YES\r
);\r
port(\r
- CLK : in std_logic;\r
- RESET : in std_logic;\r
- READOUT_ENABLE_IN : in std_logic := '1';\r
+ CLK : in std_logic;\r
+ RESET : in std_logic;\r
+ READOUT_ENABLE_IN : in std_logic := '1';\r
--connection to 1-wire interface\r
- ONEWIRE : inout std_logic;\r
- MONITOR_OUT : out std_logic;\r
+ ONEWIRE : inout std_logic;\r
+ ONEWIRE_IN : in std_logic := '0';\r
+ ONEWIRE_OUT : out std_logic := '0';\r
+ MONITOR_OUT : out std_logic;\r
--connection to id ram, according to memory map in TrbNetRegIO\r
- DATA_OUT : out std_logic_vector(15 downto 0);\r
- ADDR_OUT : out std_logic_vector(2 downto 0);\r
- WRITE_OUT : out std_logic;\r
- TEMP_OUT : out std_logic_vector(11 downto 0);\r
- ID_OUT : out std_logic_vector(63 downto 0);\r
- STAT : out std_logic_vector(31 downto 0)\r
+ DATA_OUT : out std_logic_vector(15 downto 0);\r
+ ADDR_OUT : out std_logic_vector(2 downto 0);\r
+ WRITE_OUT: out std_logic;\r
+ TEMP_OUT : out std_logic_vector(11 downto 0);\r
+ ID_OUT : out std_logic_vector(63 downto 0);\r
+ STAT : out std_logic_vector(31 downto 0)\r
);\r
end component;\r
\r
generic(
USE_TEMPERATURE_READOUT : integer range 0 to 1 := 1;
PARASITIC_MODE : integer range 0 to 1 := c_NO;
- CLK_PERIOD : integer := 10 --clk period in ns
+ CLK_PERIOD : integer := 10; --clk period in ns
+ USEINOUT : integer := c_YES
);
port(
CLK : in std_logic;
READOUT_ENABLE_IN : in std_logic := '1';
--connection to 1-wire interface
ONEWIRE : inout std_logic;
+ ONEWIRE_IN : in std_logic := '0';
+ ONEWIRE_OUT : out std_logic := '0';
MONITOR_OUT : out std_logic;
--connection to id ram, according to memory map in TrbNetRegIO
DATA_OUT : out std_logic_vector(15 downto 0);
signal strong_pullup, next_strong_pullup : std_logic;
begin
+gen_inout : if USEINOUT = c_YES generate
ONEWIRE <= '0' when output = '0' else '1' when strong_pullup = '1' else 'Z';
input <= ONEWIRE;
+
+end generate;
+gen_separate : if USEINOUT = c_NO generate
+ ONEWIRE_OUT <= output;
+ input <= ONEWIRE_IN;
+ ONEWIRE <= '0';
+end generate;
+
reset_i <= RESET when rising_edge(CLK);
STAT(3) <= send_rom;
STAT(4) <= skip_rom;
STAT(5) <= conv_temp;
- STAT(6) <= reading_temp;
+ STAT(6) <= reading_temp; --fixed, used in stand-alone 1-wire interface
STAT(7) <= buf_STAT;
STAT(11 downto 8) <= bitcounter_vector(3 downto 0);
STAT(15 downto 12)<= state_bits;