From 5c5a007ff7d9a91f73bf12525d3826779d3e1fad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Arroyo=20Torrens?= Date: Sun, 21 Jan 2018 00:41:59 +0100 Subject: [PATCH 1/7] Enable apio --verbose if showFPGAResources is selected --- app/scripts/services/tools.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/scripts/services/tools.js b/app/scripts/services/tools.js index f5a22a255..ad99a8fb7 100644 --- a/app/scripts/services/tools.js +++ b/app/scripts/services/tools.js @@ -82,6 +82,9 @@ angular.module('icestudio') }) .then(function() { var hostname = profile.get('remoteHostname'); + if (profile.get('showFPGAResources')) { + commands = commands.concat('-v'); + } if (hostname) { return executeRemote(commands, hostname); } From b3d600e791486c9f85d44957475cc55bb3e4a2d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Arroyo=20Torrens?= Date: Sun, 21 Jan 2018 00:58:20 +0100 Subject: [PATCH 2/7] Add FFs & LUTs totals for all supported boards --- app/resources/boards/TinyFPGA-B2/info.json | 2 ++ app/resources/boards/blackice-ii/info.json | 2 ++ app/resources/boards/blackice/info.json | 2 ++ app/resources/boards/go-board/info.json | 2 ++ app/resources/boards/iCE40-HX8K/info.json | 2 ++ app/resources/boards/icestick/info.json | 2 ++ app/resources/boards/icezum/info.json | 2 ++ app/resources/boards/icoboard/info.json | 2 ++ app/resources/boards/kefir/info.json | 2 ++ app/scripts/services/common.js | 2 ++ app/views/design.html | 6 ++++++ 11 files changed, 26 insertions(+) diff --git a/app/resources/boards/TinyFPGA-B2/info.json b/app/resources/boards/TinyFPGA-B2/info.json index cf53aa7e8..bae698e86 100644 --- a/app/resources/boards/TinyFPGA-B2/info.json +++ b/app/resources/boards/TinyFPGA-B2/info.json @@ -3,6 +3,8 @@ "datasheet": "https://github.com/tinyfpga/TinyFPGA-B-Series", "interface": "Serial", "FPGAResources": { + "ffs": 7680, + "luts": 7680, "pios": 23, "plbs": 960, "brams": 32 diff --git a/app/resources/boards/blackice-ii/info.json b/app/resources/boards/blackice-ii/info.json index dab618fbc..3e439fc63 100644 --- a/app/resources/boards/blackice-ii/info.json +++ b/app/resources/boards/blackice-ii/info.json @@ -3,6 +3,8 @@ "datasheet": "https://mystorm.uk/", "interface": "Serial", "FPGAResources": { + "ffs": 7680, + "luts": 7680, "pios": 107, "plbs": 960, "brams": 32 diff --git a/app/resources/boards/blackice/info.json b/app/resources/boards/blackice/info.json index 9fe925ce8..1b638c6d5 100644 --- a/app/resources/boards/blackice/info.json +++ b/app/resources/boards/blackice/info.json @@ -3,6 +3,8 @@ "datasheet": "https://mystorm.uk/", "interface": "Serial", "FPGAResources": { + "ffs": 7680, + "luts": 7680, "pios": 107, "plbs": 960, "brams": 32 diff --git a/app/resources/boards/go-board/info.json b/app/resources/boards/go-board/info.json index 2abf061a4..ef9b492a5 100644 --- a/app/resources/boards/go-board/info.json +++ b/app/resources/boards/go-board/info.json @@ -3,6 +3,8 @@ "datasheet": "https://www.nandland.com/goboard/introduction.html", "interface": "FTDI", "FPGAResources": { + "ffs": 1280, + "luts": 1280, "pios": 72, "plbs": 160, "brams": 16 diff --git a/app/resources/boards/iCE40-HX8K/info.json b/app/resources/boards/iCE40-HX8K/info.json index 6563bd309..cc711bb18 100644 --- a/app/resources/boards/iCE40-HX8K/info.json +++ b/app/resources/boards/iCE40-HX8K/info.json @@ -3,6 +3,8 @@ "datasheet": "http://www.latticesemi.com/view_document?document_id=50373", "interface": "FTDI", "FPGAResources": { + "ffs": 7680, + "luts": 7680, "pios": 206, "plbs": 960, "brams": 32 diff --git a/app/resources/boards/icestick/info.json b/app/resources/boards/icestick/info.json index b1b0cce10..b293f5e80 100644 --- a/app/resources/boards/icestick/info.json +++ b/app/resources/boards/icestick/info.json @@ -3,6 +3,8 @@ "datasheet": "http://www.latticesemi.com/icestick", "interface": "FTDI", "FPGAResources": { + "ffs": 1280, + "luts": 1280, "pios": 96, "plbs": 160, "brams": 16 diff --git a/app/resources/boards/icezum/info.json b/app/resources/boards/icezum/info.json index 8baa39d4c..a4ff2c1f5 100644 --- a/app/resources/boards/icezum/info.json +++ b/app/resources/boards/icezum/info.json @@ -3,6 +3,8 @@ "datasheet": "https://github.com/FPGAwars/icezum/wiki", "interface": "FTDI", "FPGAResources": { + "ffs": 1280, + "luts": 1280, "pios": 96, "plbs": 160, "brams": 16 diff --git a/app/resources/boards/icoboard/info.json b/app/resources/boards/icoboard/info.json index 720cff589..c00f05925 100644 --- a/app/resources/boards/icoboard/info.json +++ b/app/resources/boards/icoboard/info.json @@ -3,6 +3,8 @@ "datasheet": "http://icoboard.org/about-icoboard.html", "interface": "GPIO", "FPGAResources": { + "ffs": 7680, + "luts": 7680, "pios": 206, "plbs": 960, "brams": 32 diff --git a/app/resources/boards/kefir/info.json b/app/resources/boards/kefir/info.json index 42c78d2c0..db502aa0f 100644 --- a/app/resources/boards/kefir/info.json +++ b/app/resources/boards/kefir/info.json @@ -3,6 +3,8 @@ "datasheet": "http://fpgalibre.sourceforge.net/Kefir/", "interface": "", "FPGAResources": { + "ffs": 7680, + "luts": 7680, "pios": 107, "plbs": 960, "brams": 32 diff --git a/app/scripts/services/common.js b/app/scripts/services/common.js index 41fbd5fbb..460ef7ab9 100644 --- a/app/scripts/services/common.js +++ b/app/scripts/services/common.js @@ -25,6 +25,8 @@ angular.module('icestudio') // FPGA resources this.FPGAResources = { + ffs: '-', + luts: '-', pios: '-', plbs: '-', brams: '-' diff --git a/app/views/design.html b/app/views/design.html index 7f268e4a9..a5214464c 100644 --- a/app/views/design.html +++ b/app/views/design.html @@ -17,6 +17,12 @@
+ + FFs:  {{ common.hasChangesSinceBuild ? '-' : common.FPGAResources.ffs }} / {{ common.selectedBoard.info.FPGAResources.ffs }} + + + LUTs:  {{ common.hasChangesSinceBuild ? '-' : common.FPGAResources.luts }} / {{ common.selectedBoard.info.FPGAResources.luts }} + PIOs:  {{ common.hasChangesSinceBuild ? '-' : common.FPGAResources.pios }} / {{ common.selectedBoard.info.FPGAResources.pios }} From 816879a9577b23fd247fe054e8721746670d1a2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Arroyo=20Torrens?= Date: Sun, 21 Jan 2018 01:02:44 +0100 Subject: [PATCH 3/7] Extract LUTs from apio output --- app/scripts/services/tools.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/scripts/services/tools.js b/app/scripts/services/tools.js index ad99a8fb7..8c5e9ea4d 100644 --- a/app/scripts/services/tools.js +++ b/app/scripts/services/tools.js @@ -496,16 +496,17 @@ angular.module('icestudio') if (stdout) { // Show used resources in the FPGA - common.FPGAResources.pios = findFPGAResources(/PIOs\s+([0-9]+)\s/g, stdout, common.FPGAResources.pios); - common.FPGAResources.plbs = findFPGAResources(/PLBs\s+([0-9]+)\s/g, stdout, common.FPGAResources.plbs); - common.FPGAResources.brams = findFPGAResources(/BRAMs\s+([0-9]+)\s/g, stdout, common.FPGAResources.brams); + common.FPGAResources.luts = findValue(/LCs\s+([0-9]+)\s/g, stdout, common.FPGAResources.luts); + common.FPGAResources.pios = findValue(/PIOs\s+([0-9]+)\s/g, stdout, common.FPGAResources.pios); + common.FPGAResources.plbs = findValue(/PLBs\s+([0-9]+)\s/g, stdout, common.FPGAResources.plbs); + common.FPGAResources.brams = findValue(/BRAMs\s+([0-9]+)\s/g, stdout, common.FPGAResources.brams); utils.rootScopeSafeApply(); } } }); } - function findFPGAResources(pattern, output, previousValue) { + function findValue(pattern, output, previousValue) { var match = pattern.exec(output); return (match && match[1]) ? match[1] : previousValue; } From bdb38deec4117f067ff0001de4e2d41424778e53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Arroyo=20Torrens?= Date: Sun, 21 Jan 2018 01:07:54 +0100 Subject: [PATCH 4/7] Extract FFs from apio output --- app/scripts/services/tools.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/scripts/services/tools.js b/app/scripts/services/tools.js index 8c5e9ea4d..9090d1dac 100644 --- a/app/scripts/services/tools.js +++ b/app/scripts/services/tools.js @@ -496,6 +496,7 @@ angular.module('icestudio') if (stdout) { // Show used resources in the FPGA + common.FPGAResources.ffs = findValue(/DFF\s+([0-9]+)\s/g, stdout, common.FPGAResources.ffs); common.FPGAResources.luts = findValue(/LCs\s+([0-9]+)\s/g, stdout, common.FPGAResources.luts); common.FPGAResources.pios = findValue(/PIOs\s+([0-9]+)\s/g, stdout, common.FPGAResources.pios); common.FPGAResources.plbs = findValue(/PLBs\s+([0-9]+)\s/g, stdout, common.FPGAResources.plbs); From c08845de6691efd17372106b77535851002c0ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Arroyo=20Torrens?= Date: Sun, 21 Jan 2018 01:16:30 +0100 Subject: [PATCH 5/7] Reset FPGA resources when a project is opened --- app/scripts/services/project.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/scripts/services/project.js b/app/scripts/services/project.js index 5c120bee8..7f5727b3e 100644 --- a/app/scripts/services/project.js +++ b/app/scripts/services/project.js @@ -131,6 +131,7 @@ angular.module('icestudio') graph.resetCommandStack(); graph.fitContent(); alertify.success(gettextCatalog.getString('Project {{name}} loaded', { name: utils.bold(name) })); + common.hasChangesSinceBuild = true; }); if (ret) { From ea505dbd4833dedc01582e46e01682a2eea2fd51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Arroyo=20Torrens?= Date: Sun, 21 Jan 2018 13:48:43 +0100 Subject: [PATCH 6/7] Fix apio develop mode --- app/package.json | 2 +- app/scripts/services/utils.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/package.json b/app/package.json index 0aa8ccd64..622368072 100644 --- a/app/package.json +++ b/app/package.json @@ -25,7 +25,7 @@ "tinyfpgab" ], "external": "", - "develop": false + "develop": true }, "collection": "0.3.0", "engines": { diff --git a/app/scripts/services/utils.js b/app/scripts/services/utils.js index 0a866bfb2..ec428051f 100644 --- a/app/scripts/services/utils.js +++ b/app/scripts/services/utils.js @@ -173,7 +173,8 @@ angular.module('icestudio') this.installOnlineApio = function(callback) { var versionRange = '">=' + _package.apio.min + ',<' + _package.apio.max + '"'; var extraPackages = _package.apio.extras || []; - this.executeCommand([coverPath(common.ENV_PIP), 'install', '-U', 'apio[' + extraPackages.toString() + ']' + versionRange], callback); + var apio = _package.apio.develop ? common.APIO_PIP_VCS : 'apio'; + this.executeCommand([coverPath(common.ENV_PIP), 'install', '-U', apio + '[' + extraPackages.toString() + ']' + versionRange], callback); }; this.apioInstall = function(_package, callback) { From 7ed1fe1d5e58b546b0adf3d83c3cfcb52bff08a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Arroyo=20Torrens?= Date: Sun, 21 Jan 2018 13:49:27 +0100 Subject: [PATCH 7/7] User --verbose-arachne to capture used FPGA resources --- app/scripts/services/tools.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/scripts/services/tools.js b/app/scripts/services/tools.js index 9090d1dac..e03522e28 100644 --- a/app/scripts/services/tools.js +++ b/app/scripts/services/tools.js @@ -43,11 +43,11 @@ angular.module('icestudio') }; this.buildCode = function(startMessage, endMessage) { - return apioRun(['build', '-b', common.selectedBoard.name], startMessage, endMessage); + return apioRun(['build', '--board', common.selectedBoard.name], startMessage, endMessage); }; this.uploadCode = function(startMessage, endMessage) { - return apioRun(['upload', '-b', common.selectedBoard.name], startMessage, endMessage); + return apioRun(['upload', '--board', common.selectedBoard.name], startMessage, endMessage); }; function apioRun(commands, startMessage, endMessage) { @@ -83,7 +83,7 @@ angular.module('icestudio') .then(function() { var hostname = profile.get('remoteHostname'); if (profile.get('showFPGAResources')) { - commands = commands.concat('-v'); + commands = commands.concat('--verbose-arachne'); } if (hostname) { return executeRemote(commands, hostname); @@ -273,7 +273,7 @@ angular.module('icestudio') }, function (error, stdout, stderr/*, cmd*/) { if (!error) { startAlert.setContent(gettextCatalog.getString('Execute remote {{label}} ...', { label: '' })); - nodeSSHexec((['apio'].concat(commands).concat(['-p', '.build'])).join(' '), hostname, + nodeSSHexec((['apio'].concat(commands).concat(['--project-dir', '.build'])).join(' '), hostname, function (error, stdout, stderr) { resolve({ error: error, stdout: stdout, stderr: stderr }); });