diff options
author | 2019-11-10 19:54:26 +0100 | |
---|---|---|
committer | 2019-11-10 19:54:26 +0100 | |
commit | b8c43342d531b0bd30f8db30174f7bd1cdaa19fa (patch) | |
tree | a7e6fa34b528fb0455e601f1911797b8502ca13a /src/lib/netlist/prg/nltool.cpp | |
parent | a5f06c769538d39c8171154a798ac997a4cb3c6e (diff) |
netlist: first steps on the way to calculated parameters. [Couriersud]
This commit is a first step towards using formulas in parameters, i.e.
MAINCLOCK(clock, 20 * 30)
The intention is to improve readability and scalability.
Since device registration already provides all necessary information
about parameters, the code to create an include file for all
devices has been improved. Long term, this will remove the need for
device specific header files.
In addition going forward devices will accept either no connections or
all specified connections, i.e.
TTL_7400_NAND(name, chip1.2, chip2.3)
or
TTL_7400_NAND(name)
NET_C(...)
NET_C(...)
This will allow to remove all duplicate definitions which are currently
necessary, i.e. TTL_7400_NAND/TTL_7400_GATE
Diffstat (limited to 'src/lib/netlist/prg/nltool.cpp')
-rw-r--r-- | src/lib/netlist/prg/nltool.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/lib/netlist/prg/nltool.cpp b/src/lib/netlist/prg/nltool.cpp index 2591d49bc49..a9c1244f191 100644 --- a/src/lib/netlist/prg/nltool.cpp +++ b/src/lib/netlist/prg/nltool.cpp @@ -674,18 +674,24 @@ void tool_app_t::header_entry(const netlist::factory::element_t *e) if (!plib::startsWith(s, "@")) vs += ", p" + plib::replace_all(plib::replace_all(s, "+", ""), ".", "_"); mac_out("#define " + e->name() + "(name" + vs + ")"); - mac_out("\tNET_REGISTER_DEV(" + e->name() +", name)"); + + vs = ""; for (const auto &s : v) { pstring r(plib::replace_all(plib::replace_all(plib::replace_all(s, "+", ""), ".", "_"), "@","")); if (plib::startsWith(s, "+")) - mac_out("\tNET_CONNECT(name, " + r + ", p" + r + ")"); + vs += ", p" + r; else if (plib::startsWith(s, "@")) - mac_out("\tNET_CONNECT(name, " + r + ", " + r + ")"); + { + // automatically connected + //mac_out("\tNET_CONNECT(name, " + r + ", " + r + ")"); + } else - mac_out("\tNETDEV_PARAMI(name, " + r + ", p" + r + ")"); + vs += ", p" + r; } + + mac_out("\tNET_REGISTER_DEVEXT(" + e->name() +", name" + vs + ")", false); mac_out("", false); } @@ -730,7 +736,6 @@ void tool_app_t::create_header() pout("#ifndef NLD_DEVINC_H\n"); pout("#define NLD_DEVINC_H\n"); pout("\n"); - pout("#include \"nl_setup.h\"\n"); pout("#ifndef __PLIB_PREPROCESSOR__\n"); pout("\n"); pout("// ----------------------------------------------------------------------------\n"); |