From 2f1d16c303a540ade93cd6060b597f77cd655994 Mon Sep 17 00:00:00 2001 From: Kirigaya <1193466151@qq.com> Date: Wed, 25 Dec 2024 19:39:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=A4=9A=E4=B8=AA=E5=99=A8?= =?UTF-8?q?=E4=BB=B6=E6=A1=A5=E6=8E=A5=E7=B1=BB=E5=9E=8B=E7=9A=84=E6=B8=B2?= =?UTF-8?q?=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 - public/test.json | 244 ++++++++++++++++--------------- src/App.vue | 19 ++- src/components/setting/index.vue | 5 +- src/hook/global.js | 14 -- src/hook/render/cell.js | 38 +++-- src/hook/render/index.js | 144 ++++++++++++------ src/hook/render/layout.js | 56 ++++--- src/hook/render/port.js | 10 +- src/hook/render/yosys.js | 26 ---- src/hook/wheel-event.js | 28 +--- 11 files changed, 308 insertions(+), 277 deletions(-) diff --git a/README.md b/README.md index 033c155..b7c12c3 100644 --- a/README.md +++ b/README.md @@ -23,4 +23,3 @@ resources ``` ---- diff --git a/public/test.json b/public/test.json index d036af4..9f760a2 100644 --- a/public/test.json +++ b/public/test.json @@ -1,125 +1,137 @@ { "creator": "Yosys 0.48+5 (git sha1 7a362f1f7, clang++ 18.1.2-wasi-sdk -Oz)", "modules": { - "half_adder": { + "half_adder": { + "attributes": { + "top": "00000000000000000000000000000001", + "src": "/root/half_adder.v:1.1-9.10" + }, + "ports": { + "a": { + "direction": "input", + "bits": [ 2 ] + }, + "b": { + "direction": "input", + "bits": [ 3 ] + }, + "c": { + "direction": "input", + "bits": [ 4 ] + }, + "sum": { + "direction": "output", + "bits": [ 5 ] + }, + "carry": { + "direction": "output", + "bits": [ 6 ] + } + }, + "cells": { + "$auto$simplemap.cc:75:simplemap_bitop$81": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, "attributes": { - "top": "00000000000000000000000000000001", - "src": "/root/half_adder.v:1.1-8.10" + "src": "/root/half_adder.v:7.18-7.23" }, - "ports": { - "a": { - "direction": "input", - "bits": [ - 2 - ] - }, - "b": { - "direction": "input", - "bits": [ - 3 - ] - }, - "sum": { - "direction": "output", - "bits": [ - 4 - ] - }, - "carry": { - "direction": "output", - "bits": [ - 5 - ] - } + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" }, - "cells": { - "$auto$simplemap.cc:75:simplemap_bitop$80": { - "hide_name": 1, - "type": "$_AND_", - "parameters": {}, - "attributes": { - "src": "/root/half_adder.v:6.18-6.23" - }, - "port_directions": { - "A": "input", - "B": "input", - "Y": "output" - }, - "connections": { - "A": [ - 2 - ], - "B": [ - 3 - ], - "Y": [ - 5 - ] - } - }, - "$auto$simplemap.cc:75:simplemap_bitop$81": { - "hide_name": 1, - "type": "$_XOR_", - "parameters": {}, - "attributes": { - "src": "/root/half_adder.v:7.16-7.21" - }, - "port_directions": { - "A": "input", - "B": "input", - "Y": "output" - }, - "connections": { - "A": [ - 2 - ], - "B": [ - 3 - ], - "Y": [ - 4 - ] - } - } - }, - "netnames": { - "a": { - "hide_name": 0, - "bits": [ - 2 - ], - "attributes": { - "src": "/root/half_adder.v:2.9-2.10" - } - }, - "b": { - "hide_name": 0, - "bits": [ - 3 - ], - "attributes": { - "src": "/root/half_adder.v:3.9-3.10" - } - }, - "carry": { - "hide_name": 0, - "bits": [ - 5 - ], - "attributes": { - "src": "/root/half_adder.v:4.10-4.15" - } - }, - "sum": { - "hide_name": 0, - "bits": [ - 4 - ], - "attributes": { - "src": "/root/half_adder.v:5.10-5.13" - } - } + "connections": { + "A": [ 2 ], + "B": [ 3 ], + "Y": [ 7 ] } + }, + "$auto$simplemap.cc:75:simplemap_bitop$82": { + "hide_name": 1, + "type": "$_OR_", + "parameters": { + }, + "attributes": { + "src": "/root/half_adder.v:7.18-7.27" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 7 ], + "B": [ 4 ], + "Y": [ 6 ] + } + }, + "$auto$simplemap.cc:75:simplemap_bitop$83": { + "hide_name": 1, + "type": "$_XOR_", + "parameters": { + }, + "attributes": { + "src": "/root/half_adder.v:8.16-8.21" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 2 ], + "B": [ 3 ], + "Y": [ 5 ] + } + } + }, + "netnames": { + "$and$/root/half_adder.v:7$1_Y": { + "hide_name": 1, + "bits": [ 7 ], + "attributes": { + "src": "/root/half_adder.v:7.18-7.23" + } + }, + "a": { + "hide_name": 0, + "bits": [ 2 ], + "attributes": { + "src": "/root/half_adder.v:2.9-2.10" + } + }, + "b": { + "hide_name": 0, + "bits": [ 3 ], + "attributes": { + "src": "/root/half_adder.v:3.9-3.10" + } + }, + "c": { + "hide_name": 0, + "bits": [ 4 ], + "attributes": { + "src": "/root/half_adder.v:4.9-4.10" + } + }, + "carry": { + "hide_name": 0, + "bits": [ 6 ], + "attributes": { + "src": "/root/half_adder.v:5.10-5.15" + } + }, + "sum": { + "hide_name": 0, + "bits": [ 5 ], + "attributes": { + "src": "/root/half_adder.v:6.10-6.13" + } + } } + } } -} \ No newline at end of file + } + \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index a1c4878..09bbb28 100644 --- a/src/App.vue +++ b/src/App.vue @@ -6,17 +6,22 @@