From 919166ce5e8ee8ab437d8e3d8057e2b81992c3c5 Mon Sep 17 00:00:00 2001 From: Obijuan Date: Wed, 24 Mar 2021 13:07:12 +0100 Subject: [PATCH] Copy-2: Verilog implementation --- blocks/Copy/Copy-02.ice | 176 ++++++++++++++++++++---- blocks/Copy/Verilog/Copy-02-verilog.ice | 97 +++++++++++++ examples/00-Index.ice | 81 ++++++----- 3 files changed, 282 insertions(+), 72 deletions(-) create mode 100644 blocks/Copy/Verilog/Copy-02-verilog.ice diff --git a/blocks/Copy/Copy-02.ice b/blocks/Copy/Copy-02.ice index 5112f142..26bfd589 100644 --- a/blocks/Copy/Copy-02.ice +++ b/blocks/Copy/Copy-02.ice @@ -32,37 +32,19 @@ "clock": false }, "position": { - "x": 456, - "y": 144 + "x": 568, + "y": 160 } }, { - "id": "3266f4f1-eba1-4272-a937-4415542dcb7f", - "type": "basic.code", - "data": { - "code": "assign o = {i, i};", - "params": [], - "ports": { - "in": [ - { - "name": "i" - } - ], - "out": [ - { - "name": "o", - "range": "[1:0]", - "size": 2 - } - ] - } - }, + "id": "defdee9e-31ab-45ff-8352-e0da57699522", + "type": "80ac841b78ab68b7668296f4d0b0b4daadc7bcf9", "position": { - "x": 632, + "x": 768, "y": 144 }, "size": { - "width": 208, + "width": 96, "height": 64 } } @@ -70,14 +52,13 @@ "wires": [ { "source": { - "block": "3266f4f1-eba1-4272-a937-4415542dcb7f", - "port": "o" + "block": "defdee9e-31ab-45ff-8352-e0da57699522", + "port": "99661aef-c9bf-473e-93c4-8f5edf511d36" }, "target": { "block": "a2b77ebf-2ba8-494f-bf22-b2410234d608", "port": "in" }, - "vertices": [], "size": 2 }, { @@ -86,12 +67,147 @@ "port": "out" }, "target": { - "block": "3266f4f1-eba1-4272-a937-4415542dcb7f", - "port": "i" + "block": "defdee9e-31ab-45ff-8352-e0da57699522", + "port": "e4111201-8441-4e7d-bcd2-bcf9d265d043" } + }, + { + "source": { + "block": "cf3b4c7c-042a-45f7-b958-990d7157f928", + "port": "out" + }, + "target": { + "block": "defdee9e-31ab-45ff-8352-e0da57699522", + "port": "969e11ca-69e8-403b-a566-7bf2fbe3a5a8" + }, + "vertices": [ + { + "x": 712, + "y": 184 + } + ] } ] } }, - "dependencies": {} + "dependencies": { + "80ac841b78ab68b7668296f4d0b0b4daadc7bcf9": { + "package": { + "name": "Bus2-Join-all", + "version": "0.1", + "description": "Bus2-Join-all: Joint two wires into a 2-bits Bus", + "author": "Juan González-Gómez (Obijuan)", + "image": "%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%22354.768%22%20height=%22241.058%22%20viewBox=%220%200%20332.59497%20225.99201%22%3E%3Cpath%20d=%22M164.218%2077.643L103.07%2016.705C92.386%206.25%2078.036.461%2063.11.5H.5v26.186l61.698.046c8.012-.043%2015.705%203.133%2021.47%208.81l61.448%2061.315a57.292%2057.292%200%200%200%2039.993%2016.139%2057.292%2057.292%200%200%200-39.993%2016.14L83.668%20190.45c-5.765%205.677-13.458%208.853-21.47%208.81L.5%20199.306v26.186h62.612c14.924.039%2029.463-5.9%2040.204-16.28l60.902-60.863a29.857%2029.857%200%200%201%2021.347-8.81l146.53-.113V86.457H185.571a29.884%2029.884%200%200%201-21.353-8.814z%22%20fill=%22green%22%20stroke=%22#000%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22/%3E%3C/svg%3E" + }, + "design": { + "graph": { + "blocks": [ + { + "id": "969e11ca-69e8-403b-a566-7bf2fbe3a5a8", + "type": "basic.input", + "data": { + "name": "1", + "clock": false + }, + "position": { + "x": 112, + "y": 144 + } + }, + { + "id": "99661aef-c9bf-473e-93c4-8f5edf511d36", + "type": "basic.output", + "data": { + "name": "", + "range": "[1:0]", + "size": 2 + }, + "position": { + "x": 584, + "y": 200 + } + }, + { + "id": "e4111201-8441-4e7d-bcd2-bcf9d265d043", + "type": "basic.input", + "data": { + "name": "0", + "clock": false + }, + "position": { + "x": 112, + "y": 256 + } + }, + { + "id": "16e78204-213e-4833-9096-89d735307ec2", + "type": "basic.code", + "data": { + "code": "assign o = {i1, i0};\n", + "params": [], + "ports": { + "in": [ + { + "name": "i1" + }, + { + "name": "i0" + } + ], + "out": [ + { + "name": "o", + "range": "[1:0]", + "size": 2 + } + ] + } + }, + "position": { + "x": 296, + "y": 176 + }, + "size": { + "width": 224, + "height": 112 + } + } + ], + "wires": [ + { + "source": { + "block": "969e11ca-69e8-403b-a566-7bf2fbe3a5a8", + "port": "out" + }, + "target": { + "block": "16e78204-213e-4833-9096-89d735307ec2", + "port": "i1" + } + }, + { + "source": { + "block": "e4111201-8441-4e7d-bcd2-bcf9d265d043", + "port": "out" + }, + "target": { + "block": "16e78204-213e-4833-9096-89d735307ec2", + "port": "i0" + } + }, + { + "source": { + "block": "16e78204-213e-4833-9096-89d735307ec2", + "port": "o" + }, + "target": { + "block": "99661aef-c9bf-473e-93c4-8f5edf511d36", + "port": "in" + }, + "size": 2 + } + ] + } + } + } + } } \ No newline at end of file diff --git a/blocks/Copy/Verilog/Copy-02-verilog.ice b/blocks/Copy/Verilog/Copy-02-verilog.ice new file mode 100644 index 00000000..97b37dbb --- /dev/null +++ b/blocks/Copy/Verilog/Copy-02-verilog.ice @@ -0,0 +1,97 @@ +{ + "version": "1.2", + "package": { + "name": "Copy-2-verilog", + "version": "0.1-c1616587380260", + "description": "Copy-2: Copy the input wire twice and generate a 2 bits Bus output (Verilog implementation)", + "author": "Juan González-Gómez (Obijuan)", + "image": "%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%22311.429%22%20height=%22131.811%22%20viewBox=%220%200%2082.398813%2034.875011%22%20id=%22svg840%22%3E%3Cg%20id=%22layer2%22%20transform=%22translate(-33.717%20-91.738)%22%20fill=%22none%22%20stroke-linecap=%22round%22%3E%3Cpath%20id=%22path865-3-6%22%20d=%22M36.363%20123.968l77.107-.336%22%20stroke=%22green%22%20stroke-width=%225.292%22/%3E%3Cpath%20d=%22M88.632%20114.651l20.928-20.928%22%20id=%22path850%22%20stroke=%22#000%22%20stroke-width=%223.969%22/%3E%3Cpath%20d=%22M109.56%20114.651L88.632%2093.723%22%20id=%22path852%22%20stroke=%22#000%22%20stroke-width=%223.969%22/%3E%3C/g%3E%3Cstyle%20id=%22style263%22%3E.st0%7Bdisplay:none%7D.st1%7Bfill:none;stroke:#000;stroke-width:.75;stroke-linejoin:round;stroke-miterlimit:10%7D.st2%7Bfill:#010002%7D%3C/style%3E%3C/svg%3E" + }, + "design": { + "board": "alhambra-ii", + "graph": { + "blocks": [ + { + "id": "a2b77ebf-2ba8-494f-bf22-b2410234d608", + "type": "basic.output", + "data": { + "name": "", + "range": "[1:0]", + "size": 2 + }, + "position": { + "x": 928, + "y": 144 + } + }, + { + "id": "cf3b4c7c-042a-45f7-b958-990d7157f928", + "type": "basic.input", + "data": { + "name": "", + "clock": false + }, + "position": { + "x": 456, + "y": 144 + } + }, + { + "id": "3266f4f1-eba1-4272-a937-4415542dcb7f", + "type": "basic.code", + "data": { + "code": "assign o = {i, i};", + "params": [], + "ports": { + "in": [ + { + "name": "i" + } + ], + "out": [ + { + "name": "o", + "range": "[1:0]", + "size": 2 + } + ] + } + }, + "position": { + "x": 632, + "y": 144 + }, + "size": { + "width": 208, + "height": 64 + } + } + ], + "wires": [ + { + "source": { + "block": "3266f4f1-eba1-4272-a937-4415542dcb7f", + "port": "o" + }, + "target": { + "block": "a2b77ebf-2ba8-494f-bf22-b2410234d608", + "port": "in" + }, + "vertices": [], + "size": 2 + }, + { + "source": { + "block": "cf3b4c7c-042a-45f7-b958-990d7157f928", + "port": "out" + }, + "target": { + "block": "3266f4f1-eba1-4272-a937-4415542dcb7f", + "port": "i" + } + } + ] + } + }, + "dependencies": {} +} \ No newline at end of file diff --git a/examples/00-Index.ice b/examples/00-Index.ice index 9c4fac5c..c7bd26a2 100644 --- a/examples/00-Index.ice +++ b/examples/00-Index.ice @@ -187,18 +187,6 @@ "height": 32 } }, - { - "id": "d86dae2e-8628-44a9-b820-3c8c2da38fb3", - "type": "8e6a05097517eac31cd18607fdcf40f7e7501b42", - "position": { - "x": 1240, - "y": -464 - }, - "size": { - "width": 96, - "height": 64 - } - }, { "id": "87b36b42-bbb6-48f7-8075-c9c0fb865c50", "type": "basic.info", @@ -230,6 +218,18 @@ "width": 128, "height": 32 } + }, + { + "id": "fa74d5d6-2f69-4351-b936-da21fc4ad966", + "type": "df47f9a8523b6fdf885ff501b7da7fbc0ec32a82", + "position": { + "x": 1240, + "y": -464 + }, + "size": { + "width": 96, + "height": 64 + } } ], "wires": [] @@ -657,7 +657,7 @@ } } }, - "8e6a05097517eac31cd18607fdcf40f7e7501b42": { + "df47f9a8523b6fdf885ff501b7da7fbc0ec32a82": { "package": { "name": "Copy-2", "version": "0.1", @@ -689,37 +689,19 @@ "clock": false }, "position": { - "x": 456, - "y": 144 + "x": 568, + "y": 160 } }, { - "id": "3266f4f1-eba1-4272-a937-4415542dcb7f", - "type": "basic.code", - "data": { - "code": "assign o = {i, i};", - "params": [], - "ports": { - "in": [ - { - "name": "i" - } - ], - "out": [ - { - "name": "o", - "range": "[1:0]", - "size": 2 - } - ] - } - }, + "id": "defdee9e-31ab-45ff-8352-e0da57699522", + "type": "80ac841b78ab68b7668296f4d0b0b4daadc7bcf9", "position": { - "x": 632, + "x": 768, "y": 144 }, "size": { - "width": 208, + "width": 96, "height": 64 } } @@ -727,14 +709,13 @@ "wires": [ { "source": { - "block": "3266f4f1-eba1-4272-a937-4415542dcb7f", - "port": "o" + "block": "defdee9e-31ab-45ff-8352-e0da57699522", + "port": "99661aef-c9bf-473e-93c4-8f5edf511d36" }, "target": { "block": "a2b77ebf-2ba8-494f-bf22-b2410234d608", "port": "in" }, - "vertices": [], "size": 2 }, { @@ -743,9 +724,25 @@ "port": "out" }, "target": { - "block": "3266f4f1-eba1-4272-a937-4415542dcb7f", - "port": "i" + "block": "defdee9e-31ab-45ff-8352-e0da57699522", + "port": "e4111201-8441-4e7d-bcd2-bcf9d265d043" } + }, + { + "source": { + "block": "cf3b4c7c-042a-45f7-b958-990d7157f928", + "port": "out" + }, + "target": { + "block": "defdee9e-31ab-45ff-8352-e0da57699522", + "port": "969e11ca-69e8-403b-a566-7bf2fbe3a5a8" + }, + "vertices": [ + { + "x": 712, + "y": 184 + } + ] } ] }