OpenCores
URL https://opencores.org/ocsvn/epc_rfid_transponder/epc_rfid_transponder/trunk

Subversion Repositories epc_rfid_transponder

[/] [epc_rfid_transponder/] [trunk/] [InvSelFlags.vhd] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 erwing
-------------------------------------------------------------------------------
2
--     Politecnico di Torino                                              
3
--     Dipartimento di Automatica e Informatica             
4
-------------------------------------------------------------------------------
5
-------------------------------------------------------------------------------     
6
--
7
--     Title          : EPC Class1 Gen2 RFID Tag - Inventoried and Selected Flags Model
8
--
9
--     File name      : InvSelFlags.vhd 
10
--
11
--     Description    : Simulation model of Inventoried and Selected Flags. It
12
--                      includes persistence time as described in the EPC
13
--                      standard v. 1.09.
14
--                      
15 3 erwing
--     Authors        : Erwing R. Sanchez <erwing.sanchez@polito.it>
16 2 erwing
--                                 
17
-------------------------------------------------------------------------------            
18
-------------------------------------------------------------------------------
19
 
20
library IEEE;
21
use IEEE.STD_LOGIC_1164.all;
22
use IEEE.std_logic_unsigned.all;
23
 
24
 
25
 
26
entity InvSelFlag is
27
  port (
28
    S1i : in  std_logic;
29
    S2i : in  std_logic;
30
    S3i : in  std_logic;
31
    SLi : in  std_logic;
32
    S1o : out std_logic;
33
    S2o : out std_logic;
34
    S3o : out std_logic;
35
    SLo : out std_logic);
36
 
37
end InvSelFlag;
38
 
39
 
40
architecture Flags1 of InvSelFlag is
41
-- synopsys synthesis_off
42
  constant S1INV_PERSISTENCE_TIME : time := 500 ms;
43
  constant S2INV_PERSISTENCE_TIME : time := 2 sec;
44
  constant S3INV_PERSISTENCE_TIME : time := 2 sec;
45
  constant SL_PERSISTENCE_TIME    : time := 2 sec;
46
 
47
  constant TM_STEP          : time      := 10 ns;
48
  signal   S1_time_cnt      : time      := 1 ns;
49
  signal   S2_time_cnt      : time      := 1 ns;
50
  signal   S3_time_cnt      : time      := 1 ns;
51
  signal   SL_time_cnt      : time      := 1 ns;
52
  signal   S1_time_cnt_flag : std_logic := '0';
53
  signal   S2_time_cnt_flag : std_logic := '0';
54
  signal   S3_time_cnt_flag : std_logic := '0';
55
  signal   SL_time_cnt_flag : std_logic := '0';
56
 
57
 
58
 
59
  -- synopsys synthesis_on 
60
begin  -- Flags1
61
-- synopsys synthesis_off
62
  S1FLAG : process (S1_time_cnt_flag, S1i)
63
  begin  -- process S1FLAG  
64
    if S1i'event and (S1i = '0' or S1i = '1') then
65
      S1o         <= S1i;
66
      S1_time_cnt <= 0 ns after TM_STEP;
67
    elsif S1_time_cnt_flag'event then
68
      if S1_time_cnt = S1INV_PERSISTENCE_TIME then
69
        S1o         <= 'X';
70
        S1_time_cnt <= 0 ns after TM_STEP;
71
      else
72
        S1_time_cnt <= S1_time_cnt + TM_STEP after TM_STEP;
73
      end if;
74
    end if;
75
  end process S1FLAG;
76
 
77
  S1FLAG_flag : process (S1_time_cnt)
78
  begin  -- process S1FLAG_MIRROR
79
    S1_time_cnt_flag <= not S1_time_cnt_flag;
80
  end process S1FLAG_flag;
81
 
82
 
83
  S2FLAG : process (S2_time_cnt_flag, S2i)
84
  begin  -- process S2FLAG  
85
    if S2i'event and (S2i = '0' or S2i = '1') then
86
      S2o         <= S2i;
87
      S2_time_cnt <= 0 ns after TM_STEP;
88
    elsif S2_time_cnt_flag'event then
89
      if S2_time_cnt = S2INV_PERSISTENCE_TIME then
90
        S2o         <= 'X';
91
        S2_time_cnt <= 0 ns after TM_STEP;
92
      else
93
        S2_time_cnt <= S2_time_cnt + TM_STEP after TM_STEP;
94
      end if;
95
    end if;
96
  end process S2FLAG;
97
 
98
  S2FLAG_flag : process (S2_time_cnt)
99
  begin  -- process S2FLAG_MIRROR
100
    S2_time_cnt_flag <= not S2_time_cnt_flag;
101
  end process S2FLAG_flag;
102
 
103
  S3FLAG : process (S3_time_cnt_flag, S3i)
104
  begin  -- process S3FLAG  
105
    if S3i'event and (S3i = '0' or S3i = '1') then
106
      S3o         <= S3i;
107
      S3_time_cnt <= 0 ns after TM_STEP;
108
    elsif S3_time_cnt_flag'event then
109
      if S3_time_cnt = S3INV_PERSISTENCE_TIME then
110
        S3o         <= 'X';
111
        S3_time_cnt <= 0 ns after TM_STEP;
112
      else
113
        S3_time_cnt <= S3_time_cnt + TM_STEP after TM_STEP;
114
      end if;
115
    end if;
116
  end process S3FLAG;
117
 
118
  S3FLAG_flag : process (S3_time_cnt)
119
  begin  -- process S3FLAG_MIRROR
120
    S3_time_cnt_flag <= not S3_time_cnt_flag;
121
  end process S3FLAG_flag;
122
 
123
  SLFLAG : process (SL_time_cnt_flag, SLi)
124
  begin  -- process SLFLAG  
125
    if SLi'event and (SLi = '0' or SLi = '1') then
126
      SLo         <= SLi;
127
      SL_time_cnt <= 0 ns after TM_STEP;
128
    elsif SL_time_cnt_flag'event then
129
      if SL_time_cnt = SL_PERSISTENCE_TIME then
130
        SLo         <= 'X';
131
        SL_time_cnt <= 0 ns after TM_STEP;
132
      else
133
        SL_time_cnt <= SL_time_cnt + TM_STEP after TM_STEP;
134
      end if;
135
    end if;
136
  end process SLFLAG;
137
 
138
  SLFLAG_flag : process (SL_time_cnt)
139
  begin  -- process SLFLAG_MIRROR
140
    SL_time_cnt_flag <= not SL_time_cnt_flag;
141
  end process SLFLAG_flag;
142
-- synopsys synthesis_on
143
end Flags1;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.