-
Notifications
You must be signed in to change notification settings - Fork 22
/
QUICK_START
102 lines (81 loc) · 5.07 KB
/
QUICK_START
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
PSLSE Quick Start Guide
Environment Variable Setting:
This code checkout would run well for PSL8 based AFU verification as well as for PSL9 based verification
Ensure that the following environment variable setting is done based on the usage
for PSL8 based AFU verification, ensure that (for kshell windows) all xterms have this setting:
export PSLVER=8
for PSL9 based AFU verification, ensure that (for kshell windows) all xterms have this setting:
export PSLVER=9
SETUP:
1) Use "make" to build the code in afu_driver/src. You will have to first set
the environment variable VPI_USER_H_DIR. The value must point to the
directory that contains the file "vpi_user.h". This file is provided
by the Verilog simulator. "make" will build "veriuser.sl" and
"libvpi.so" for your simulator. Refer to your simulator's
documentation for details on how to use Verilog VPI. You will only
need 1 of these files. Which one will depend on your simulator.
- Update done to migrate the VPI usage on the afu_driver.c to the DPI constructs
- we need to point to the "svdpi.h" file which will be present at the simulation tool's
"include" directory
- the Makefile ensures that the appropriate env variable "VPI_USER_H_DIR" is set
2) Use top.v in afu_driver/verilog as a top level wrapper around your AFU
Verilog. Build a model as required for your simulator. You may need to set flags
or options to allow SystemVerilog keywords as top.v include references to
C code that uses SystemVerilog DPI functionality.
The libdpi.so created in the previous step should be pointed to for compile.
For ease of operation, suggest creation of a softlink to the $PSLSE_INSTALL_DIR/afu_driver/src/libdpi.so
NOTE: when compiling the top.v, ensure that proper "define" is passed on, based on the usage
ie, for PSL8 based AFU verification "-define PSL8" must be provided to the compiler
for PSL9 based AFU verification "-define PSL9" must be provided.
3) Use "make" to compile the code in the directory pslse.
This creates a stand-alone executable that mimics the behavior of
PSL/CAPP and the kernel code that supports it.
4) Use "make" to compile the code in the directory libcxl. This creates both
libcxl.a archive library version of libcxl as well as libcxl.so shared
object version of libcxl.
5) On the Simulation window, ensure that your LD_LIBRARY_PATH env
variable has these paths in it - $PSLSE_INSTALL_DIR/libcxl:$PSLSE_INSTALL_DIR/afu_driver/src
6) Look at the Makefiles in sample_app for examples of how to build your
application with libcxl. If you build with libcxl.so then you don't
have to re-compile your application if libcxl changes. You can just
re-compile libcxl and libcxl.so is picked up at runtime. However, this
method requires the the environment variable LD_LIBRARY_PATH contains
the libcxl path at runtime. Alternatively, you can compile with
libcxl.a. When using libcxl.a you don't need to set any environment
variables but you do need to recompile your application any time that
libcxl is recompiled.
7) Use sample_app/app.c as an example to start coding your application with
libcxl calls using the functions in libcxl.h.
8) Build your application.
RUNNING:
1) Start your simulator with the model that uses top.v as it's top level and
uses the afu_driver/src code for DPI functions. Most simulators use LD_LIBRARY_PATH
to find the afu_driver/src compiled code and DPI libraries. Check with your simulator
for complete details. Allow your simulator to advance time and you should eventually
get a message in the simulator output similiar to this:
"AFU Server is waiting for connection on machine.domain.com:32768"
2) Edit pslse/shim_host.dat to point an AFU at your simulator. For example:
afu0.0,machine.domain.com:32768
If necessary, set the SHIM_HOST_DAT environment variable to override the
path to this file.
3) Edit pslse/pslse.parms as desired, or leave the defaults to get started.
If necessary, override the path to this file using the PSLSE_PARMS
environment variable.
4) Optional: If you need to specify a non-default path for configuration or log
files, use these environment variables:
SHIM_HOST_DAT: specifies path to the `shim_host.dat` file.
PSLSE_PARMS: specifies path to the `pslse.parms` file.
5) Start pslse with ./pslse in pslse directory. If time is advancing in the simulator,
pslse will connect to the simulator and you will see a message from pslse with a
hostname and port similiar to this:
"INFO : Started PSLSE server, listening on machine.domain.com:16384"
indicating it is ready for a host application to run and connect to pslse.
6) In the directory where you will run your application code create the file
pslse_server.dat and put the host:port provided by pslse in it. For
example:
machine.domain.com:16384
7) Start your application. Run your application multiple times if desired.
If necessary, override the path to the `pslse_server.dat` file using the
PSLSE_SERVER_DAT environment variable.
8) When run is complete you can stop pslse executable with Ctrl-C to cleanly
disconnect from the simulator.