@@ -21,7 +21,7 @@ third-party components and libraries, code written by other people. To do this
21
21
we use a tool called a ** package manager** . In the ** Process Design Team** , the
22
22
package manager we use is called [ vcpkg] ( https://vcpkg.io/ ) . While ` vcpkg ` is
23
23
nominally a package manager for C/C++ projects, it's suitable to be used with
24
- any collection of files including with our System Verilog projects.
24
+ any collection of files including with our SystemVerilog projects.
25
25
26
26
One of the dependencies we'll be interested in for the purposes of verification
27
27
will be a test framework. A test framework provides utilities for running and
@@ -43,28 +43,29 @@ not yet written. We will need to add it ourselves.
43
43
## Registries
44
44
45
45
A ** registry** is a collection of information about ** packages** , where packages
46
- are the source code files (System Verilog , C++, or even cmake files) that we wish
46
+ are the source code files (SystemVerilog , C++, or even cmake files) that we wish
47
47
to use in our project. We keep track of the registries we're using in a given
48
- project with the ` vcpkg-configuration .json ` file.
48
+ project with the ` vcpkg.json ` file.
49
49
50
- If you look at the ` vcpkg-configuration .json ` file in the Lab 4 repo, you will
51
- find something that looks like the following:
50
+ If you look at the ` vcpkg.json ` file in the Lab 4 repo, you will
51
+ find something that looks like the following under ` "vcpkg-configuration" ` :
52
52
53
53
```
54
54
{
55
55
"default-registry": {
56
56
"kind": "git",
57
- "baseline": "b4f29c54450ddfc7efd2989cb9d32158ae291b40 ",
57
+ "baseline": "6046e48163a26252f7a8f4aa036cbdd9eb793c20 ",
58
58
"repository": "https://github.com/microsoft/vcpkg.git"
59
59
},
60
60
"registries": []
61
61
}
62
62
```
63
63
64
- This is a registry listing, a json file that tells ` vcpkg ` where to look for
64
+ This is a registry listing, a json object that tells ` vcpkg ` where to look for
65
65
packages. In this case, the only registry listed is the ` default-registry ` ,
66
66
which is where ` vcpkg ` will search if a requested package is not listed for
67
- any other registry. Here the ` default-registry ` is pointed at a git repo managed by Microsoft, which has many useful packages in it. The ` registries ` list, which
67
+ any other registry. Here the ` default-registry ` is pointed at a git repo managed
68
+ by Microsoft, which has many useful packages in it. The ` registries ` list, which
68
69
would contain all other registries we wish to use, is empty.
69
70
70
71
We will need to add a registry to the registry list. The required fields for a
@@ -116,8 +117,8 @@ tells `vcpkg` that this registry will provide every package that begins with
116
117
117
118
## Dependencies
118
119
119
- Now take a look at ` vcpkg.json ` , this file describes our project. It should
120
- look something like this:
120
+ Now take a look at the rest of ` vcpkg.json ` , this file describes our project. It
121
+ should look something like this:
121
122
122
123
```
123
124
{
@@ -129,7 +130,10 @@ look something like this:
129
130
"Vito Gamberini <[email protected] >"
130
131
],
131
132
"license": "CC0-1.0",
132
- "dependencies": []
133
+ "dependencies": [],
134
+ "vcpkg-configuration": {
135
+ ...
136
+ }
133
137
}
134
138
```
135
139
@@ -139,7 +143,7 @@ where we'll list the packages we need `vcpkg` to fetch for us.
139
143
The packages we'll need for this lab are:
140
144
141
145
* ` nyu-cmake ` : Utility functions for ` cmake ` . These functions make working with
142
- System Verilog more convenient
146
+ SystemVerilog more convenient
143
147
144
148
* ` catch2 ` : The catch2 test framework mentioned above
145
149
@@ -179,8 +183,8 @@ We're actually going to create a special kind of library called an ***interface
179
183
library*** . This differs slightly from a "normal" library because an interface
180
184
library can consist of code and files that aren't compiled immediately.
181
185
182
- Our System Verilog files cannot be compiled directly, so they're a good fit for
183
- this style of library. To create our System Verilog library, add the following
186
+ Our SystemVerilog files cannot be compiled directly, so they're a good fit for
187
+ this style of library. To create our SystemVerilog library, add the following
184
188
line to the CML:
185
189
186
190
``` cmake
@@ -205,7 +209,7 @@ Now we can add code to the `rtl/CMakeLists.txt` file, and it will be run by
205
209
` cmake ` when it reaches the ` add_subdirectory() ` command.
206
210
207
211
One of the important commands that the ` nyu-cmake ` package gives us is
208
- ` nyu_add_sv() ` , which lets us associate System Verilog files with a library (or
212
+ ` nyu_add_sv() ` , which lets us associate SystemVerilog files with a library (or
209
213
any other ` cmake ` "target").
210
214
211
215
In the ` rtl ` CML file, add the following lines:
@@ -286,18 +290,18 @@ use the `add_executable()` command to create an executable named `tests` and
286
290
the ` target_sources() ` command to add all the ` .cpp ` files in the ` dv ` directory
287
291
as sources.
288
292
289
- We also need to associate the ` lab4 ` System Verilog library to our executable.
293
+ We also need to associate the ` lab4 ` SystemVerilog library to our executable.
290
294
We do this with the following command from the ` nyu-util ` package:
291
295
292
296
``` cmake
293
297
nyu_link_sv(tests PRIVATE lab4)
294
298
```
295
299
296
- This takes all the System Verilog files we associated with the ` lab4 ` library,
300
+ This takes all the SystemVerilog files we associated with the ` lab4 ` library,
297
301
and also associates them with our ` tests ` executable. But we still need to tell
298
302
` cmake ` what to do with these files.
299
303
300
- To transform a System Verilog file into a _ model_ , like the ones in Lab2 and
304
+ To transform a SystemVerilog file into a _ model_ , like the ones in Lab2 and
301
305
Lab3, we need to tell the ` verilator ` tool which modules we would like to be
302
306
exposed for simulation. These exposed modules are called *** top modules*** , and
303
307
we'll need to tell ` cmake ` and ` verilator ` about them explicitly.
@@ -391,7 +395,7 @@ it using the same procedure used for the previous two labs.
391
395
* What is a package?
392
396
393
397
* What's the difference between an interface library and a "normal" library or
394
- executable? Can you think of any uses for this besides System Verilog files?
398
+ executable? Can you think of any uses for this besides SystemVerilog files?
395
399
(Think about source code used for generic programming)
396
400
397
401
* What is a top module?
0 commit comments