blob: 808ce9a256867a4539edaad6d6476762b0448b72 (
plain) (
blame)
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
|
# Adding devices to netlist
There are basically two kind of devices you can add to netlist:
- coded devices. These can be found in the devices and analog folder. Typically
these are logic or elementary (i.e. resistor, capacitor) devices.
- netlist language devices. These are found in the macro folder structure.
Typically these are dip layouts or devices consisting of elementary devices. A good
example are operational amplifier models or VCOs.
In prior netlist releases (<=0.13.0) it was cumbersome to add devices. You had to make
sure to add references and code in a number of different locations.
All necessary header files are now created automatically.
## Stand alone compilation
### Coded devices
Just add your device code (e.g. nld_device.cpp) into the devices folder.
Switch to the `build` directory
`cd build`
and type
`make generated`
to create all the infrastructure code.
### Macro devices
Place the device code (e.g. nlmod_device.cpp) into macro/modules.
Switch to the `build` directory
`cd build`
and type
`make generated`
to create all the infrastructure code.
## Visual Studio build
You need to add the files manually to the Visual Studio solution.
## MAME integration
In addition to the the steps above you have to add your code additions to the
`scripts/src/netlist.lua` file.
Make sure to
```sh
cd src/lib/netlist/build
make generated
```
to (re)create the necessary files in the `generated` directory.
## Background
### What does `make generated` do?
`make generated` calls three python scripts:
- `create_devinc.py`
- `create_lib_entries.py`
- `create_modules.py`
which create the following files in the `generated` directory:
- `nld_devinc.h`
- `lib_entries.hxx`
- `nlm_modules_lib.cpp`
The information contained in these files in the past had to be included in various places
and files previously. Since the information can be extracted programmatically the
manual process now was replaced.
|