summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/adding_devices.md
diff options
context:
space:
mode:
author couriersud <couriersud@gmx.org>2020-09-06 23:24:21 +0200
committer couriersud <couriersud@gmx.org>2020-09-12 23:20:16 +0200
commitca31c844cde7f54a285e3b9da358989e42258f5b (patch)
treef9e4a963b999e1352a4611a43a7c10c2d80957e7 /src/lib/netlist/adding_devices.md
parentcda35c94020dbcb8dad8309aba11374c356c501e (diff)
netlist: move to generated header and link support files files.
* Removed device and macro header files. * All of those can be generated automatically so going forward there is no need for these any longer. * Introduced the modules concept. Modules are netlists for which automatic lib entries are generated. * Going forward you just store them in macro/modules and they will be automatically registered as device elements. * You need to do a "make generated" is src/lib/netlist/build * Some_device.cpp still needs to be added to netlist.lua * Added documentation on how to add devices to netlist. * Please refer to adding_devices.md for more information.
Diffstat (limited to 'src/lib/netlist/adding_devices.md')
-rw-r--r--src/lib/netlist/adding_devices.md82
1 files changed, 82 insertions, 0 deletions
diff --git a/src/lib/netlist/adding_devices.md b/src/lib/netlist/adding_devices.md
new file mode 100644
index 00000000000..808ce9a2568
--- /dev/null
+++ b/src/lib/netlist/adding_devices.md
@@ -0,0 +1,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.