Skip to content

Commit

Permalink
litex_sim: add GPIO module exposed through simctrl
Browse files Browse the repository at this point in the history
Adds a GPIO controller module, which is exposed through
simctrl. Supports driving GPIO pins, as well as querying the current
pin state (input/output) and signal state. Exposes a JSON-based
interface through the simctrl payload.

Signed-off-by: Leon Schuermann <leon@is.currently.online>
  • Loading branch information
lschuermann committed Nov 17, 2021
1 parent 538ea26 commit aad6e5f
Show file tree
Hide file tree
Showing 4 changed files with 471 additions and 1 deletion.
2 changes: 1 addition & 1 deletion litex/build/sim/core/modules/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include ../variables.mak
MODULES = simctrl xgmii_ethernet gmii_ethernet ethernet serial2console serial2tcp clocker spdeeprom
MODULES = simctrl gpio xgmii_ethernet gmii_ethernet ethernet serial2console serial2tcp clocker spdeeprom

.PHONY: $(MODULES)
all: $(MODULES)
Expand Down
14 changes: 14 additions & 0 deletions litex/build/sim/core/modules/gpio/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
include ../../variables.mak
UNAME_S := $(shell uname -s)

include $(SRC_DIR)/modules/rules.mak

CFLAGS += -I$(TAPCFG_DIRECTORY)/src/include
OBJS = $(MOD).o

$(MOD).so: $(OBJS)
ifeq ($(UNAME_S),Darwin)
$(CC) $(LDFLAGS) -o $@ $^
else
$(CC) $(LDFLAGS) -Wl,-soname,$@ -o $@ $^
endif
Loading

0 comments on commit aad6e5f

Please sign in to comment.