Skip to content

Commit

Permalink
Update all examples to final format 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesus89 committed Dec 22, 2016
1 parent 5b80992 commit b82c1ec
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 53 deletions.
27 changes: 18 additions & 9 deletions app/resources/examples/icestick/1_basic/1_led_on.ice
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"version": "1.0",
"package": {
"name": "",
"version": "",
"name": "Led on",
"version": "1.0.0",
"description": "",
"author": "",
"image": ""
Expand All @@ -12,9 +12,8 @@
"graph": {
"blocks": [
{
"id": "f9239f87-12a4-4141-85f7-c3862615af3a",
"id": "eaf792b5-de98-4e2f-b78a-4023eb9a7f2b",
"type": "bit.1",
"data": {},
"position": {
"x": 80,
"y": 64
Expand All @@ -24,9 +23,7 @@
"id": "949075cb-26c0-49da-ba76-2496ea9aa7cc",
"type": "basic.output",
"data": {
"label": "led",
"name": "led",
"range": "",
"pins": [
{
"index": "0",
Expand Down Expand Up @@ -67,7 +64,7 @@
"wires": [
{
"source": {
"block": "f9239f87-12a4-4141-85f7-c3862615af3a",
"block": "eaf792b5-de98-4e2f-b78a-4023eb9a7f2b",
"port": "19c8f68d-5022-487f-9ab0-f0a3cd58bead"
},
"target": {
Expand Down Expand Up @@ -96,10 +93,14 @@
"type": "basic.code",
"data": {
"code": "// Bit 1\n\nassign v = 1'b1;",
"params": [],
"ports": {
"in": [],
"out": [
"v"
{
"name": "v",
"size": 1
}
]
}
},
Expand All @@ -112,7 +113,15 @@
"id": "19c8f68d-5022-487f-9ab0-f0a3cd58bead",
"type": "basic.output",
"data": {
"label": ""
"name": "",
"pins": [
{
"index": "0",
"name": "",
"value": "0"
}
],
"virtual": true
},
"position": {
"x": 608,
Expand Down
27 changes: 18 additions & 9 deletions app/resources/examples/icezum/1_basic/1_led_on.ice
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"version": "1.0",
"package": {
"name": "",
"version": "",
"name": "Led on",
"version": "1.0.0",
"description": "",
"author": "",
"image": ""
Expand All @@ -12,9 +12,8 @@
"graph": {
"blocks": [
{
"id": "8c3d15a4-2311-4a24-8321-6036eb0eb92b",
"id": "eaf792b5-de98-4e2f-b78a-4023eb9a7f2b",
"type": "bit.1",
"data": {},
"position": {
"x": 80,
"y": 64
Expand All @@ -24,9 +23,7 @@
"id": "949075cb-26c0-49da-ba76-2496ea9aa7cc",
"type": "basic.output",
"data": {
"label": "led",
"name": "led",
"range": "",
"pins": [
{
"index": "0",
Expand Down Expand Up @@ -67,7 +64,7 @@
"wires": [
{
"source": {
"block": "8c3d15a4-2311-4a24-8321-6036eb0eb92b",
"block": "eaf792b5-de98-4e2f-b78a-4023eb9a7f2b",
"port": "19c8f68d-5022-487f-9ab0-f0a3cd58bead"
},
"target": {
Expand Down Expand Up @@ -96,10 +93,14 @@
"type": "basic.code",
"data": {
"code": "// Bit 1\n\nassign v = 1'b1;",
"params": [],
"ports": {
"in": [],
"out": [
"v"
{
"name": "v",
"size": 1
}
]
}
},
Expand All @@ -112,7 +113,15 @@
"id": "19c8f68d-5022-487f-9ab0-f0a3cd58bead",
"type": "basic.output",
"data": {
"label": ""
"name": "",
"pins": [
{
"index": "0",
"name": "",
"value": "0"
}
],
"virtual": true
},
"position": {
"x": 608,
Expand Down
8 changes: 2 additions & 6 deletions app/resources/examples/icezum/1_basic/2_switch_led.ice
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"version": "1.0",
"package": {
"name": "",
"version": "",
"name": "Switch led",
"version": "1.0.0",
"description": "",
"author": "",
"image": ""
Expand All @@ -15,9 +15,7 @@
"id": "aac1b394-533e-4410-9f35-ba80af8abd63",
"type": "basic.input",
"data": {
"label": "button",
"name": "button",
"range": "",
"pins": [
{
"index": "0",
Expand All @@ -36,9 +34,7 @@
"id": "30a83e46-176d-40a8-ac0e-f19a131ea9d9",
"type": "basic.output",
"data": {
"label": "led",
"name": "led",
"range": "",
"pins": [
{
"index": "0",
Expand Down
81 changes: 54 additions & 27 deletions app/resources/examples/icezum/1_basic/3_switch_and_gate.ice
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
"id": "aa8bab8b-61e4-4e28-b444-0e68d9484ea1",
"type": "basic.input",
"data": {
"label": "button1",
"name": "button1",
"range": "",
"pins": [
{
"index": "0",
Expand All @@ -33,21 +31,18 @@
}
},
{
"id": "81f8eceb-3742-4350-8833-78fef262c542",
"id": "840e71b2-bf5a-4e20-8413-d386500c87fa",
"type": "logic.gate.and",
"data": {},
"position": {
"x": 248,
"x": 256,
"y": 80
}
},
{
"id": "3cad6e72-e7d3-4273-be1c-ce5f9b4c020a",
"type": "basic.output",
"data": {
"label": "led",
"name": "led",
"range": "",
"pins": [
{
"index": "0",
Expand All @@ -66,9 +61,7 @@
"id": "5d1b4f33-ae65-4154-b4f4-ff1403437600",
"type": "basic.input",
"data": {
"label": "button2",
"name": "button2",
"range": "",
"pins": [
{
"index": "0",
Expand Down Expand Up @@ -109,32 +102,32 @@
"wires": [
{
"source": {
"block": "aa8bab8b-61e4-4e28-b444-0e68d9484ea1",
"port": "out"
"block": "840e71b2-bf5a-4e20-8413-d386500c87fa",
"port": "664caf9e-5f40-4df4-800a-b626af702e62"
},
"target": {
"block": "81f8eceb-3742-4350-8833-78fef262c542",
"port": "18c2ebc7-5152-439c-9b3f-851c59bac834"
"block": "3cad6e72-e7d3-4273-be1c-ce5f9b4c020a",
"port": "in"
}
},
{
"source": {
"block": "5d1b4f33-ae65-4154-b4f4-ff1403437600",
"block": "aa8bab8b-61e4-4e28-b444-0e68d9484ea1",
"port": "out"
},
"target": {
"block": "81f8eceb-3742-4350-8833-78fef262c542",
"port": "97b51945-d716-4b6c-9db9-970d08541249"
"block": "840e71b2-bf5a-4e20-8413-d386500c87fa",
"port": "18c2ebc7-5152-439c-9b3f-851c59bac834"
}
},
{
"source": {
"block": "81f8eceb-3742-4350-8833-78fef262c542",
"port": "664caf9e-5f40-4df4-800a-b626af702e62"
"block": "5d1b4f33-ae65-4154-b4f4-ff1403437600",
"port": "out"
},
"target": {
"block": "3cad6e72-e7d3-4273-be1c-ce5f9b4c020a",
"port": "in"
"block": "840e71b2-bf5a-4e20-8413-d386500c87fa",
"port": "97b51945-d716-4b6c-9db9-970d08541249"
}
}
]
Expand All @@ -158,13 +151,23 @@
"type": "basic.code",
"data": {
"code": "// AND logic gate\n\nassign c = a & b;",
"params": [],
"ports": {
"in": [
"a",
"b"
{
"name": "a",
"size": 1
},
{
"name": "b",
"size": 1
}
],
"out": [
"c"
{
"name": "c",
"size": 1
}
]
}
},
Expand All @@ -177,7 +180,15 @@
"id": "18c2ebc7-5152-439c-9b3f-851c59bac834",
"type": "basic.input",
"data": {
"label": ""
"name": "",
"pins": [
{
"index": "0",
"name": "",
"value": "0"
}
],
"virtual": true
},
"position": {
"x": 64,
Expand All @@ -188,7 +199,15 @@
"id": "664caf9e-5f40-4df4-800a-b626af702e62",
"type": "basic.output",
"data": {
"label": ""
"name": "",
"pins": [
{
"index": "0",
"name": "",
"value": "0"
}
],
"virtual": true
},
"position": {
"x": 752,
Expand All @@ -199,7 +218,15 @@
"id": "97b51945-d716-4b6c-9db9-970d08541249",
"type": "basic.input",
"data": {
"label": ""
"name": "",
"pins": [
{
"index": "0",
"name": "",
"value": "0"
}
],
"virtual": true
},
"position": {
"x": 64,
Expand Down Expand Up @@ -246,7 +273,7 @@
"x": 0,
"y": 0
},
"zoom": 0.9999999784900666
"zoom": 1
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions app/scripts/services/compiler.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ angular.module('icestudio')
return 'v' + nodeSha1(id).toString().substring(0, 6);
}
else {
return id.replace('.', '_');
return id.replace(/\./g, '_');
}
}

Expand Down Expand Up @@ -242,7 +242,6 @@ angular.module('icestudio')
block.type !== 'basic.info') {

// Header

instance += name;
if (block.type === 'basic.code') {
instance += '_' + digestId(block.id);
Expand Down

0 comments on commit b82c1ec

Please sign in to comment.