start adding c structs for gates and ports

This commit is contained in:
Redo0
2021-05-25 14:54:26 -05:00
parent be2df1ef33
commit 8561940777
7 changed files with 86 additions and 43 deletions

View File

@@ -1,7 +1,7 @@
PortTypes = {
output = 0,
input = 1
input = 1,
}
PortDirections = {
@@ -13,9 +13,20 @@ PortDirections = {
[5] = {0, 0, -1}
}
Port = {
logictype = 1,
}
Port = {}
FFI.cdef[[
struct Gate;
struct Port {
bool state;
char type;
char direction;
bool causeupdate;
int position[3];
struct Gate* gate;
struct Net* group;
};
]]
function Port.new(self, type, direction, position, causeupdate, sim)
local o = {