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

Subversion Repositories funbase_ip_library

[/] [funbase_ip_library/] [trunk/] [TUT/] [ip.hwp.communication/] [basic_tester/] [1.0/] [readme.txt] - Blame information for rev 145

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 145 lanttu
-----------------------
2
Basic tester component
3
-----------------------
4
 
5
Purpose: Send and receive simple test data to/from HIBI.
6
         It is easy to create basic tests for new HIBI-compliant IP component,
7
         e.g. writing and reading a couple registers.
8
 
9
Structure:
10
        Two components: tx and rx, both using the same
11
        pkg that defines procedure for reading traffic file.
12
 
13
        Example testbench instantiates tx, rx, and two HIBI (r4) wrappers.
14
 
15
 
16
        file --> basic_tester_tx --> hibi2_r4
17
                                       |
18
                                       |
19
                                       v
20
        file --> basic_tester_rx <-- hibi2_r4
21
                      |
22
                      |
23
                      V
24
                      "Error msg if something went wrong"
25
 
26
 
27
Usage:
28
        Go to directory sim.
29
 
30
        Define env variable TMP_DIR
31
        so that it points to some temporary dir where the compiled
32
        stuff will be located, e.g. $PWD or /tmp/ or similar.
33
 
34
        Create VHDL work lib and compile all files by executing:
35
        ./create_makefile
36
 
37
        Start simulation:
38
        vsim tb_basic_tester -novopt -do tb_basic_tester.do
39
 
40
        Traffic examples take only about 600 ns to execute.
41
        There will be 3 messagtes after statup
42
        1) tx reaches the end of its config file
43
        2) rx detects the intentional data corruption for the last data word
44
        3) rx reaches the end of its config file
45
 
46
        In addition to violated assertions, rx unit will have internal
47
        signal "error_r" that will go upon an error condition.
48
        However, this might get optimized away if you don't use
49
        the flag "-novopt".
50
 
51
Configuration:
52
        Traffic is configured with ASCII text files that are
53
        located into same directory where ModelSim is launched
54
        ("sim" in this case). They look pretty much the same
55
        for both tx and rx.
56
 
57
        There is one line for each transfer.
58
 
59
        Files can have comments (#) and empty lines
60
 
61
        Each transfer has up to 4 parameter:
62
        delay_in_cycles dst_addr data_value command
63
 
64
        Parameters are separated with space or tab.
65
        Delay is 4 hexadecimal characters, addr and data 8 char each,
66
        and command 2 hex characters. Read procedure will
67
        discard the line if it cannot interpret the line, e.g. if
68
        there is only "5" and not "0005" for the delay.
69
 
70
        Command can be omitted and then default write will be used.
71
 
72
        Address 0...0 means that tx does not send a new address,
73
        whereas  rx assumes that addr does not change:
74
        a) it receives the same addr as on prev transfers,
75
        b) or it does not receive addr at all but new data.
76
 
77
        Value F..F  on rx side means that rx don't care about
78
        that value. However, it still checks the other parameters.
79
        E.g. any incoming addr will match but the data will be checked.
80
 
81
 
82
Checked cases in rx:
83
 
84
        Next transfer arrives within "delay" clock cycles" after reading the conf file.
85
        Addr matches the specified value
86
        Addr does not change
87
        Data matches
88
        Command matches
89
        Some combination of addr/data/cmd matches
90
        If more data arrives than expected
91
 
92
 
93
Testing your own IP
94
        For example, send few commands with basic_tester_tx
95
        and configure rx according to expected responses.
96
 
97
        file --> basic_tester_tx --> hibi2_r4
98
        file --> basic_tester_rx <-- wrapper
99
                                       ^
100
                                       |
101
                                       v
102
                                    hibi2_r4 --> your IP
103
                                    wrapper <--  is here              |
104
 
105
 
106
---
107
 
108
Erno Salminen, TUT
109
2010-10-08

powered by: WebSVN 2.1.0

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