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 2

Go to most recent revision | 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
--     Authors        : Erwing R. Sanchez <erwing.sanchezsanchez@polito.it>
16
--
17
--     Rev. History   : 29 June 06 
18
--                                 
19
-------------------------------------------------------------------------------            
20
-------------------------------------------------------------------------------
21
 
22
library IEEE;
23
use IEEE.STD_LOGIC_1164.all;
24
use IEEE.std_logic_unsigned.all;
25
 
26
 
27
 
28
entity InvSelFlag is
29
  port (
30
    S1i : in  std_logic;
31
    S2i : in  std_logic;
32
    S3i : in  std_logic;
33
    SLi : in  std_logic;
34
    S1o : out std_logic;
35
    S2o : out std_logic;
36
    S3o : out std_logic;
37
    SLo : out std_logic);
38
 
39
end InvSelFlag;
40
 
41
 
42
architecture Flags1 of InvSelFlag is
43
-- synopsys synthesis_off
44
  constant S1INV_PERSISTENCE_TIME : time := 500 ms;
45
  constant S2INV_PERSISTENCE_TIME : time := 2 sec;
46
  constant S3INV_PERSISTENCE_TIME : time := 2 sec;
47
  constant SL_PERSISTENCE_TIME    : time := 2 sec;
48
 
49
  constant TM_STEP          : time      := 10 ns;
50
  signal   S1_time_cnt      : time      := 1 ns;
51
  signal   S2_time_cnt      : time      := 1 ns;
52
  signal   S3_time_cnt      : time      := 1 ns;
53
  signal   SL_time_cnt      : time      := 1 ns;
54
  signal   S1_time_cnt_flag : std_logic := '0';
55
  signal   S2_time_cnt_flag : std_logic := '0';
56
  signal   S3_time_cnt_flag : std_logic := '0';
57
  signal   SL_time_cnt_flag : std_logic := '0';
58
 
59
 
60
 
61
  -- synopsys synthesis_on 
62
begin  -- Flags1
63
-- synopsys synthesis_off
64
  S1FLAG : process (S1_time_cnt_flag, S1i)
65
  begin  -- process S1FLAG  
66
    if S1i'event and (S1i = '0' or S1i = '1') then
67
      S1o         <= S1i;
68
      S1_time_cnt <= 0 ns after TM_STEP;
69
    elsif S1_time_cnt_flag'event then
70
      if S1_time_cnt = S1INV_PERSISTENCE_TIME then
71
        S1o         <= 'X';
72
        S1_time_cnt <= 0 ns after TM_STEP;
73
      else
74
        S1_time_cnt <= S1_time_cnt + TM_STEP after TM_STEP;
75
      end if;
76
    end if;
77
  end process S1FLAG;
78
 
79
  S1FLAG_flag : process (S1_time_cnt)
80
  begin  -- process S1FLAG_MIRROR
81
    S1_time_cnt_flag <= not S1_time_cnt_flag;
82
  end process S1FLAG_flag;
83
 
84
 
85
  S2FLAG : process (S2_time_cnt_flag, S2i)
86
  begin  -- process S2FLAG  
87
    if S2i'event and (S2i = '0' or S2i = '1') then
88
      S2o         <= S2i;
89
      S2_time_cnt <= 0 ns after TM_STEP;
90
    elsif S2_time_cnt_flag'event then
91
      if S2_time_cnt = S2INV_PERSISTENCE_TIME then
92
        S2o         <= 'X';
93
        S2_time_cnt <= 0 ns after TM_STEP;
94
      else
95
        S2_time_cnt <= S2_time_cnt + TM_STEP after TM_STEP;
96
      end if;
97
    end if;
98
  end process S2FLAG;
99
 
100
  S2FLAG_flag : process (S2_time_cnt)
101
  begin  -- process S2FLAG_MIRROR
102
    S2_time_cnt_flag <= not S2_time_cnt_flag;
103
  end process S2FLAG_flag;
104
 
105
  S3FLAG : process (S3_time_cnt_flag, S3i)
106
  begin  -- process S3FLAG  
107
    if S3i'event and (S3i = '0' or S3i = '1') then
108
      S3o         <= S3i;
109
      S3_time_cnt <= 0 ns after TM_STEP;
110
    elsif S3_time_cnt_flag'event then
111
      if S3_time_cnt = S3INV_PERSISTENCE_TIME then
112
        S3o         <= 'X';
113
        S3_time_cnt <= 0 ns after TM_STEP;
114
      else
115
        S3_time_cnt <= S3_time_cnt + TM_STEP after TM_STEP;
116
      end if;
117
    end if;
118
  end process S3FLAG;
119
 
120
  S3FLAG_flag : process (S3_time_cnt)
121
  begin  -- process S3FLAG_MIRROR
122
    S3_time_cnt_flag <= not S3_time_cnt_flag;
123
  end process S3FLAG_flag;
124
 
125
  SLFLAG : process (SL_time_cnt_flag, SLi)
126
  begin  -- process SLFLAG  
127
    if SLi'event and (SLi = '0' or SLi = '1') then
128
      SLo         <= SLi;
129
      SL_time_cnt <= 0 ns after TM_STEP;
130
    elsif SL_time_cnt_flag'event then
131
      if SL_time_cnt = SL_PERSISTENCE_TIME then
132
        SLo         <= 'X';
133
        SL_time_cnt <= 0 ns after TM_STEP;
134
      else
135
        SL_time_cnt <= SL_time_cnt + TM_STEP after TM_STEP;
136
      end if;
137
    end if;
138
  end process SLFLAG;
139
 
140
  SLFLAG_flag : process (SL_time_cnt)
141
  begin  -- process SLFLAG_MIRROR
142
    SL_time_cnt_flag <= not SL_time_cnt_flag;
143
  end process SLFLAG_flag;
144
-- synopsys synthesis_on
145
end Flags1;

powered by: WebSVN 2.1.0

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