diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..ca761e6 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,11 @@ +FROM wokwi/builder-clang-wasm + +USER root +RUN apk add gcompat libc6-compat + +# Install arduino-cli: +RUN wget -O /tmp/cli.tar.gz \ + https://downloads.arduino.cc/arduino-cli/arduino-cli_latest_Linux_64bit.tar.gz && \ + tar -C /usr/local/bin -zxvf /tmp/cli.tar.gz && \ + rm /tmp/cli.tar.gz +RUN arduino-cli core update-index && arduino-cli core install arduino:avr diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..8a0bd9b --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,11 @@ +{ + "name": "Wokwi-chips clang ", + "dockerFile": "Dockerfile", + "customizations": { + "vscode": { + "extensions": [ + "Wokwi.wokwi-vscode" + ] + } + } +} diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..70e91b3 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,49 @@ +name: Build Chip + +on: + push: + workflow_dispatch: + +jobs: + build: + name: Build + runs-on: ubuntu-22.04 + steps: + - name: Check out repository + uses: actions/checkout@v3 + - name: Build chip + uses: wokwi/wokwi-chip-clang-action@main + with: + sources: "src/main.c" + - name: Copy chip.json + run: sudo cp chip.json dist + - name: 'Upload Artifacts' + uses: actions/upload-artifact@v3 + with: + name: chip + path: | + dist/chip.json + dist/chip.wasm + + # The release job only runs when you push a tag starting with "v", e.g. v1.0.0 + release: + name: Release + needs: build + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + steps: + - name: Download compiled chip + uses: actions/download-artifact@v3 + with: + name: chip + path: chip + - name: Create a zip archive + run: cd chip && zip -9 ../chip.zip chip.* + env: + ZIP_VERSION: ${{ github.ref_name }} + - name: Upload release + uses: ncipollo/release-action@v1 + with: + artifacts: chip.zip + token: ${{ secrets.GITHUB_TOKEN }} + generateReleaseNotes: true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6fc7bee --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +dist diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..37ff25a --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + "recommendations": [ + "wokwi.wokwi-vscode", + "ms-vscode.makefile-tools", + "vsciot-vscode.vscode-arduino" + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..4a5bb38 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,9 @@ +{ + "makefile.launchConfigurations": [ + { + "cwd": "/workspaces/sn5454/dist", + "binaryPath": "/workspaces/sn5454/dist/chip.wasm", + "binaryArgs": [] + } + ] +} \ No newline at end of file diff --git a/LICENSE b/LICENSE index 5fd3470..6e79ab5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,21 @@ -MIT License - -Copyright (c) 2024 wokwi-custom-chips - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +The MIT License (MIT) + +Copyright (c) 2022 Uri Shaked + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..98e3850 --- /dev/null +++ b/Makefile @@ -0,0 +1,31 @@ +# SPDX-FileCopyrightText: © 2022 Uri Shaked +# SPDX-License-Identifier: MIT + +SOURCES = src/main.c +TARGET = dist/chip.wasm +testFileName = logic +testFolderName = test + +.PHONY: all +all: $(TARGET) dist/chip.json ; \ + +.PHONY: clean +clean: + rm -rf dist ; \ + rm -rf $(testFolderName) ; \ + + +dist: + mkdir -p dist + +$(TARGET): dist $(SOURCES) src/wokwi-api.h + clang --target=wasm32-unknown-wasi --sysroot /opt/wasi-libc -nostartfiles -Wl,--import-memory -Wl,--export-table -Wl,--no-entry -Werror -o $(TARGET) $(SOURCES) + +dist/chip.json: dist chip.json + cp chip.json dist + + +.PHONY: test +test: + mkdir -p $(testFolderName) ; \ + cd test && arduino-cli sketch new $(testFileName) && arduino-cli compile -e -b arduino:avr:uno $(testFileName) ; \ \ No newline at end of file diff --git a/README.md b/README.md index 4ba2e89..87a0d20 100644 --- a/README.md +++ b/README.md @@ -1 +1,23 @@ -# sn5454 \ No newline at end of file +# 4-Wide AND-OR-INVERT Gates + +Example of a basic custom chip for [Wokwi](https://wokwi.com/). + +The actual source code for the chip lives in [src/main.c](src/main.c), and the pins are described in [chip.json](chip.json). + +## DOCS +Chip functionalities and how to use it are explained in docs . +[Go-to-docs](docs/README.md) + +## Building + +The easiest way to build the project is to open it inside a Visual Studio Code dev container, and then run the `make` command. + +## Testing + +You can test this project using the [Wokwi extension for VS Code](https://marketplace.visualstudio.com/items?itemName=wokwi.wokwi-vscode). Open the project with Visual Studio Code, press "F1" and select "Wokwi: Start Simulator". + +If you want to make changes to the test project firmware, edit [test/logic/sketch.ino](test/logic/sketch.ino), and then run `make test` to rebuild the .hex file. You'll need the [arduino-cli](https://arduino.github.io/arduino-cli/latest/installation/), which is already installed in the dev container. + +## License + +This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more details. diff --git a/chip.json b/chip.json new file mode 100644 index 0000000..02552a7 --- /dev/null +++ b/chip.json @@ -0,0 +1,22 @@ +{ + "name": "sn5454", + "docs": "https://github.com/wokwi-custom-chips/sn5454/blob/main/docs/README.md", + "author": "algovoid", + "pins": [ + "A", + "C", + "D", + "E", + "F", + "NC", + "GND", + "Y", + "G", + "H", + "NU", + "NU", + "B", + "VCC" + ], + "controls": [] +} \ No newline at end of file diff --git a/diagram.json b/diagram.json new file mode 100644 index 0000000..b6752d7 --- /dev/null +++ b/diagram.json @@ -0,0 +1,41 @@ +{ + "version": 1, + "author": "algovoid", + "editor": "wokwi", + "parts": [ + { "type": "chip-sn5454", "id": "chip1", "top": 116.22, "left": 120, "attrs": {} }, + { + "type": "wokwi-led", + "id": "led1", + "top": 140.4, + "left": 311.4, + "attrs": { "color": "green", "flip": "1" } + }, + { "type": "wokwi-vcc", "id": "vcc1", "top": -28.04, "left": 220.8, "attrs": {} }, + { "type": "wokwi-gnd", "id": "gnd1", "top": 268.8, "left": 114.6, "attrs": {} }, + { "type": "wokwi-dip-switch-8", "id": "sw1", "top": 25.5, "left": -27.3, "attrs": {} } + ], + "connections": [ + [ "chip1:GND", "gnd1:GND", "black", [ "h0" ] ], + [ "chip1:VCC", "vcc1:VCC", "red", [ "h1.81", "v-76.8" ] ], + [ "chip1:Y", "led1:A", "green", [ "v0" ] ], + [ "gnd1:GND", "led1:C", "black", [ "v0", "h211.2" ] ], + [ "sw1:1a", "chip1:A", "green", [ "v0" ] ], + [ "sw1:2a", "chip1:B", "green", [ "v28.8", "h259.2", "v28.8" ] ], + [ "sw1:3a", "chip1:C", "green", [ "v0" ] ], + [ "sw1:4a", "chip1:D", "green", [ "v0" ] ], + [ "sw1:5a", "chip1:E", "green", [ "v0" ] ], + [ "sw1:6a", "chip1:F", "green", [ "v0" ] ], + [ "sw1:7a", "chip1:G", "green", [ "v124.8", "h211.2", "v-28.8" ] ], + [ "sw1:8a", "chip1:H", "green", [ "v134.4", "h211.2", "v-48" ] ], + [ "vcc1:VCC", "sw1:8b", "red", [ "v0" ] ], + [ "vcc1:VCC", "sw1:7b", "red", [ "v19.2", "h-192" ] ], + [ "vcc1:VCC", "sw1:6b", "red", [ "v9.6", "h-201.6" ] ], + [ "vcc1:VCC", "sw1:5b", "red", [ "v9.6", "h-211.2" ] ], + [ "vcc1:VCC", "sw1:4b", "red", [ "v19.2", "h-220.8" ] ], + [ "vcc1:VCC", "sw1:3b", "red", [ "v9.6", "h-230.4" ] ], + [ "vcc1:VCC", "sw1:2b", "red", [ "v19.2", "h-240" ] ], + [ "vcc1:VCC", "sw1:1b", "red", [ "v9.6", "h-249.6" ] ] + ], + "dependencies": {} +} \ No newline at end of file diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..9c562c1 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,46 @@ +# Wokwi sn5454 Chip + +This is a custom chip for [Wokwi](https://wokwi.com/). It implements the sn5454 IC. + +## Description + +The sn5454 contains 4-wide AND-OR-INVERT. They perform the Boolean function +of Y = NOT( (A . B) + (C . D) + (E . F) + (G . H) ) . + +## Pin names + +| Name | Description | +| ---- | ----------------- | +| A | Input signal A | +| B | Input signal B | +| C | Input signal C | +| D | Input signal D | +| E | Input signal E | +| F | Input signal F | +| G | Input signal G | +| H | Input signal H | +| Y | Output signal | +| GND | Ground | +| VCC | Supply voltage | + + +## Usage + +To use this chip in your project, include it as a dependency in your `diagram.json` file: + +```json + "dependencies": { + "chip-sn5454": "github:wokwi-custom-chips/sn5454@0.1.0" + } +``` + +Then, add the chip to your circuit by adding a `chip-sn5454` item to the `parts` section of diagram.json: + +```json + "parts": { + ..., + { "type": "chip-sn5454", "id": "chip1" } + }, +``` + +For a complete example, see [The sn5454 chip test project](https://wokwi.com/projects/399264986831740929). diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..a9f34ca --- /dev/null +++ b/src/main.c @@ -0,0 +1,93 @@ +// SPDX-License-Identifier: MIT +// Copyright 2024 Algovoid + +#include "wokwi-api.h" +#include +#include + +typedef struct { + pin_t pin_A; + pin_t pin_B; + pin_t pin_C; + pin_t pin_D; + pin_t pin_E; + pin_t pin_F; + pin_t pin_G; + pin_t pin_H; + pin_t pin_Y; +} chip_state_t; + +uint8_t subGate1; +uint8_t subGate2; +uint8_t subGate3; +uint8_t subGate4; + +static void set_logic(chip_state_t *chip) { + subGate1 = pin_read(chip->pin_A) & pin_read(chip->pin_B) ; + subGate2 = pin_read(chip->pin_C) & pin_read(chip->pin_D); + subGate3 = pin_read(chip->pin_E) & pin_read(chip->pin_F) ; + subGate4 = pin_read(chip->pin_G) & pin_read(chip->pin_H) ; + pin_write(chip->pin_Y, !( subGate1 | subGate2 | subGate3 | subGate4 ) ); +} + + +static void chip_pin_change(void *user_data, pin_t pin, uint32_t value) { + chip_state_t *chip = (chip_state_t*)user_data; + set_logic(chip); + // uncomment to see gates and output states + //printf("Gate 1 : %d\n" , subGate1); + //printf("Gate 2 : %d\n" , subGate2); + //printf("Gate 3 : %d\n" , subGate3); + //printf("Gate 4 : %d\n" , subGate4); + //printf("Output State : %u\n" , pin_read(chip->pin_Y)); +} + + +void chip_init() { + printf("Initialize sn5454 chip!\n"); + chip_state_t *chip = malloc(sizeof(chip_state_t)); + + chip->pin_A = pin_init("A", INPUT); + chip->pin_B = pin_init("B", INPUT); + chip->pin_C = pin_init("C", INPUT); + + chip->pin_D = pin_init("D", INPUT); + chip->pin_E = pin_init("E", INPUT); + chip->pin_F = pin_init("F", INPUT); + + chip->pin_G = pin_init("G", INPUT); + chip->pin_H = pin_init("H", INPUT); + chip->pin_Y = pin_init("Y", OUTPUT); + + pin_write(chip->pin_A, LOW); + pin_write(chip->pin_B, LOW); + + pin_write(chip->pin_C, LOW); + pin_write(chip->pin_D, LOW); + + pin_write(chip->pin_E, LOW); + pin_write(chip->pin_F, LOW); + + pin_write(chip->pin_G, LOW); + pin_write(chip->pin_H, LOW); + + const pin_watch_config_t config = { + .edge = BOTH, + .pin_change = chip_pin_change, + .user_data = chip, + }; + + pin_watch(chip->pin_A, &config); + pin_watch(chip->pin_B, &config); + + pin_watch(chip->pin_C, &config); + pin_watch(chip->pin_D, &config); + + pin_watch(chip->pin_E, &config); + pin_watch(chip->pin_F, &config); + + pin_watch(chip->pin_G, &config); + pin_watch(chip->pin_H, &config); + + set_logic(chip); +} \ No newline at end of file diff --git a/src/wokwi-api.h b/src/wokwi-api.h new file mode 100644 index 0000000..01300a5 --- /dev/null +++ b/src/wokwi-api.h @@ -0,0 +1,138 @@ +#include +#include + +#ifndef WOKWI_API_H +#define WOKWI_API_H + +enum pin_value { + LOW = 0, + HIGH = 1 +}; + +enum pin_mode { + INPUT = 0, + OUTPUT = 1, + INPUT_PULLUP = 2, + INPUT_PULLDOWN = 3, + ANALOG = 4, + + OUTPUT_LOW = 16, + OUTPUT_HIGH = 17, +}; + +enum edge { + RISING = 1, + FALLING = 2, + BOTH = 3, +}; + +int __attribute__((export_name("__wokwi_api_version_1"))) __attribute__((weak)) __wokwi_api_version_1(void) { return 1; } + +#ifdef __cplusplus +extern "C" { +#endif + +typedef int32_t pin_t; +#define NO_PIN ((pin_t)-1) + +typedef struct { + void *user_data; + uint32_t edge; + void (*pin_change)(void *user_data, pin_t pin, uint32_t value); +} pin_watch_config_t; + +extern __attribute__((export_name("chipInit"))) void chip_init(void); + +extern __attribute__((import_name("pinInit"))) pin_t pin_init(const char *name, uint32_t mode); + +extern __attribute__((import_name("pinRead"))) uint32_t pin_read(pin_t pin); +extern __attribute__((import_name("pinWrite"))) void pin_write(pin_t pin, uint32_t value); +extern __attribute__((import_name("pinWatch"))) bool pin_watch(pin_t pin, const pin_watch_config_t *config); +extern __attribute__((import_name("pinWatchStop"))) void pin_watch_stop(pin_t pin); +extern __attribute__((import_name("pinMode"))) void pin_mode(pin_t pin, uint32_t value); +extern __attribute__((import_name("pinADCRead"))) float pin_adc_read(pin_t pin); +extern __attribute__((import_name("pinDACWrite"))) float pin_dac_write(pin_t pin, float voltage); + +extern __attribute__((import_name("attrInit"))) uint32_t attr_init(const char *name, uint32_t default_value); +extern __attribute__((import_name("attrInit"))) uint32_t attr_init_float(const char *name, float default_value); +extern __attribute__((import_name("attrRead"))) uint32_t attr_read(uint32_t attr_id); +extern __attribute__((import_name("attrReadFloat"))) float attr_read_float(uint32_t attr_id); + +typedef struct { + void *user_data; + uint32_t address; + pin_t scl; + pin_t sda; + bool (*connect)(void *user_data, uint32_t address, bool connect); + uint8_t (*read)(void *user_data); + bool (*write)(void *user_data, uint8_t data); + void (*disconnect)(void *user_data); + uint32_t reserved[8]; +} i2c_config_t; + +typedef uint32_t i2c_dev_t; + +extern __attribute__((import_name("i2cInit"))) i2c_dev_t i2c_init(const i2c_config_t *config); + +typedef struct { + void *user_data; + pin_t rx; + pin_t tx; + uint32_t baud_rate; + void (*rx_data)(void *user_data, uint8_t byte); + void (*write_done)(void *user_data); + uint32_t reserved[8]; +} uart_config_t; + +typedef uint32_t uart_dev_t; + +extern __attribute__((import_name("uartInit"))) uart_dev_t uart_init(const uart_config_t *config); +extern __attribute__((import_name("uartWrite"))) bool uart_write(uart_dev_t uart, uint8_t *buffer, uint32_t count); + +typedef struct { + void *user_data; + pin_t sck; + pin_t mosi; + pin_t miso; + uint32_t mode; + void (*done)(void *user_data, uint8_t *buffer, uint32_t count); + uint32_t reserved[8]; +} spi_config_t; +typedef uint32_t spi_dev_t; + +extern __attribute__((import_name("spiInit"))) spi_dev_t spi_init(const spi_config_t *spi_config); +extern __attribute__((import_name("spiStart"))) void spi_start(const spi_dev_t spi, uint8_t *buffer, uint32_t count); +extern __attribute__((import_name("spiStop"))) void spi_stop(const spi_dev_t spi); + +typedef struct { + void *user_data; + void (*callback)(void *user_data); + uint32_t reserved[8]; +} timer_config_t; + +typedef uint32_t timer_t; + +extern __attribute__((import_name("timerInit"))) timer_t timer_init(const timer_config_t *config); +extern __attribute__((import_name("timerStart"))) void timer_start(const timer_t timer, uint32_t micros, bool repeat); +extern __attribute__((import_name("timerStartNanos"))) void timer_start_ns_d(const timer_t timer, double nanos, bool repeat); +static void timer_start_ns(const timer_t timer, uint64_t nanos, bool repeat) { + timer_start_ns_d(timer, (double)nanos, repeat); +} +extern __attribute__((import_name("timerStop"))) void timer_stop(const timer_t timer); + +extern __attribute__((import_name("getSimNanos"))) double get_sim_nanos_d(void); + +static uint64_t get_sim_nanos(void) { + return (uint64_t)get_sim_nanos_d(); +} + +typedef uint32_t buffer_t; +extern __attribute__((import_name("framebufferInit"))) buffer_t framebuffer_init(uint32_t *pixel_width, uint32_t *pixel_height); +extern __attribute__((import_name("bufferRead"))) void buffer_read(buffer_t buffer, uint32_t offset, uint8_t *data, uint32_t data_len); +extern __attribute__((import_name("bufferWrite"))) void buffer_write(buffer_t buffer, uint32_t offset, uint8_t *data, uint32_t data_len); + +#ifdef __cplusplus +} +#endif + +#endif /* WOKWI_API_H */ diff --git a/test/logic/build/arduino.avr.uno/logic.ino.eep b/test/logic/build/arduino.avr.uno/logic.ino.eep new file mode 100644 index 0000000..1996e8f --- /dev/null +++ b/test/logic/build/arduino.avr.uno/logic.ino.eep @@ -0,0 +1 @@ +:00000001FF diff --git a/test/logic/build/arduino.avr.uno/logic.ino.elf b/test/logic/build/arduino.avr.uno/logic.ino.elf new file mode 100644 index 0000000..51a9895 Binary files /dev/null and b/test/logic/build/arduino.avr.uno/logic.ino.elf differ diff --git a/test/logic/build/arduino.avr.uno/logic.ino.hex b/test/logic/build/arduino.avr.uno/logic.ino.hex new file mode 100644 index 0000000..6cf1da1 --- /dev/null +++ b/test/logic/build/arduino.avr.uno/logic.ino.hex @@ -0,0 +1,29 @@ +:100000000C9434000C9446000C9446000C9446006A +:100010000C9446000C9446000C9446000C94460048 +:100020000C9446000C9446000C9446000C94460038 +:100030000C9446000C9446000C9446000C94460028 +:100040000C9448000C9446000C9446000C94460016 +:100050000C9446000C9446000C9446000C94460008 +:100060000C9446000C94460011241FBECFEFD8E03C +:10007000DEBFCDBF21E0A0E0B1E001C01D92A930FC +:10008000B207E1F70E9492000C94DC000C9400008F +:100090001F920F920FB60F9211242F933F938F93BD +:1000A0009F93AF93BF938091050190910601A0911A +:1000B0000701B09108013091040123E0230F2D378F +:1000C00058F50196A11DB11D2093040180930501EF +:1000D00090930601A0930701B0930801809100015D +:1000E00090910101A0910201B09103010196A11D1F +:1000F000B11D8093000190930101A0930201B09380 +:100100000301BF91AF919F918F913F912F910F90DC +:100110000FBE0F901F90189526E8230F0296A11D81 +:10012000B11DD2CF789484B5826084BD84B58160DE +:1001300084BD85B5826085BD85B5816085BD8091B2 +:100140006E00816080936E0010928100809181002A +:100150008260809381008091810081608093810022 +:10016000809180008160809380008091B1008460E4 +:100170008093B1008091B00081608093B000809145 +:100180007A00846080937A0080917A008260809304 +:100190007A0080917A00816080937A0080917A0061 +:1001A000806880937A001092C100C0E0D0E0209770 +:0C01B000F1F30E940000FBCFF894FFCF99 +:00000001FF diff --git a/test/logic/build/arduino.avr.uno/logic.ino.with_bootloader.bin b/test/logic/build/arduino.avr.uno/logic.ino.with_bootloader.bin new file mode 100644 index 0000000..cadf07e Binary files /dev/null and b/test/logic/build/arduino.avr.uno/logic.ino.with_bootloader.bin differ diff --git a/test/logic/build/arduino.avr.uno/logic.ino.with_bootloader.hex b/test/logic/build/arduino.avr.uno/logic.ino.with_bootloader.hex new file mode 100644 index 0000000..105cf74 --- /dev/null +++ b/test/logic/build/arduino.avr.uno/logic.ino.with_bootloader.hex @@ -0,0 +1,63 @@ +:020000040000FA +:100000000C9434000C9446000C9446000C9446006A +:100010000C9446000C9446000C9446000C94460048 +:100020000C9446000C9446000C9446000C94460038 +:100030000C9446000C9446000C9446000C94460028 +:100040000C9448000C9446000C9446000C94460016 +:100050000C9446000C9446000C9446000C94460008 +:100060000C9446000C94460011241FBECFEFD8E03C +:10007000DEBFCDBF21E0A0E0B1E001C01D92A930FC +:10008000B207E1F70E9492000C94DC000C9400008F +:100090001F920F920FB60F9211242F933F938F93BD +:1000A0009F93AF93BF938091050190910601A0911A +:1000B0000701B09108013091040123E0230F2D378F +:1000C00058F50196A11DB11D2093040180930501EF +:1000D00090930601A0930701B0930801809100015D +:1000E00090910101A0910201B09103010196A11D1F +:1000F000B11D8093000190930101A0930201B09380 +:100100000301BF91AF919F918F913F912F910F90DC +:100110000FBE0F901F90189526E8230F0296A11D81 +:10012000B11DD2CF789484B5826084BD84B58160DE +:1001300084BD85B5826085BD85B5816085BD8091B2 +:100140006E00816080936E0010928100809181002A +:100150008260809381008091810081608093810022 +:10016000809180008160809380008091B1008460E4 +:100170008093B1008091B00081608093B000809145 +:100180007A00846080937A0080917A008260809304 +:100190007A0080917A00816080937A0080917A0061 +:1001A000806880937A001092C100C0E0D0E0209770 +:0C01B000F1F30E940000FBCFF894FFCF99 +:107E0000112484B714BE81FFF0D085E080938100F7 +:107E100082E08093C00088E18093C10086E0809377 +:107E2000C20080E18093C4008EE0C9D0259A86E02C +:107E300020E33CEF91E0309385002093840096BBD3 +:107E4000B09BFECF1D9AA8958150A9F7CC24DD24C4 +:107E500088248394B5E0AB2EA1E19A2EF3E0BF2EE7 +:107E6000A2D0813461F49FD0082FAFD0023811F036 +:107E7000013811F484E001C083E08DD089C08234E0 +:107E800011F484E103C0853419F485E0A6D080C0E4 +:107E9000853579F488D0E82EFF2485D0082F10E0AE +:107EA000102F00270E291F29000F111F8ED06801E7 +:107EB0006FC0863521F484E090D080E0DECF843638 +:107EC00009F040C070D06FD0082F6DD080E0C81688 +:107ED00080E7D80618F4F601B7BEE895C0E0D1E017 +:107EE00062D089930C17E1F7F0E0CF16F0E7DF06D8 +:107EF00018F0F601B7BEE89568D007B600FCFDCFD4 +:107F0000A601A0E0B1E02C9130E011968C91119780 +:107F100090E0982F8827822B932B1296FA010C0160 +:107F200087BEE89511244E5F5F4FF1E0A038BF0790 +:107F300051F7F601A7BEE89507B600FCFDCF97BE46 +:107F4000E89526C08437B1F42ED02DD0F82E2BD052 +:107F50003CD0F601EF2C8F010F5F1F4F84911BD097 +:107F6000EA94F801C1F70894C11CD11CFA94CF0C13 +:107F7000D11C0EC0853739F428D08EE10CD085E9AC +:107F80000AD08FE07ACF813511F488E018D01DD067 +:107F900080E101D065CF982F8091C00085FFFCCF94 +:107FA0009093C60008958091C00087FFFCCF809118 +:107FB000C00084FD01C0A8958091C6000895E0E648 +:107FC000F0E098E1908380830895EDDF803219F02E +:107FD00088E0F5DFFFCF84E1DECF1F93182FE3DFCA +:107FE0001150E9F7F2DF1F91089580E0E8DFEE27F6 +:047FF000FF270994CA +:027FFE00040479 +:00000001FF diff --git a/test/logic/logic.ino b/test/logic/logic.ino new file mode 100644 index 0000000..74f966a --- /dev/null +++ b/test/logic/logic.ino @@ -0,0 +1,6 @@ + +void setup() { +} + +void loop() { +} diff --git a/wokwi.toml b/wokwi.toml new file mode 100644 index 0000000..fa052c6 --- /dev/null +++ b/wokwi.toml @@ -0,0 +1,8 @@ +[wokwi] +version = 1 +elf = 'test/logic/build/arduino.avr.uno/logic.ino.elf' +firmware = 'test/logic/build/arduino.avr.uno/logic.ino.hex' + +[[chip]] +name = 'sn5454' +binary = 'dist/chip.wasm'