Skip to content

Commit

Permalink
Support for .exe in SConstruct
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesus89 committed Mar 4, 2016
1 parent 910197b commit 08a6e32
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 21 deletions.
20 changes: 6 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,13 @@ Experimental graphic editor for open FPGAs. Tested with Linux and [iCEstick boar

![][icestudio-demo]

### Install dependencies

Install [apio](https://github.com/bqlabs/apio)
```bash
pip install apio
```

Install tools: scons, icestorm, icestick rules.
```bash
apio install
```

## Usage

Download the [latest release](https://github.com/bqlabs/icestudio/releases), unpack the zip and execute Icestudio.
1. Install the toolchain with [apio](https://github.com/bqlabs/apio#install)

NOTE: this is an **early experimental version**. Although frontend Icestudio works multiplatform, Apio backend is only available for Linux x86. We are working on having the backend also for win, osx and arm architectures.
2. Download the [latest release](https://github.com/bqlabs/icestudio/releases), unpack the zip and execute Icestudio.

NOTE: this is an **early experimental version**. Initially supported on Linux (32, 64), Windows and Mac.

## Development

Expand All @@ -45,6 +35,8 @@ Install nw-builder
sudo npm install -g nw-builder
```

Install the toolchain with [apio](https://github.com/bqlabs/apio#install)

### Download

```bash
Expand Down
14 changes: 10 additions & 4 deletions icestudio/SConstruct
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import os
import platform
from SCons.Script import (Builder, Environment, Default)

EXT = ''
if 'Windows' == platform.system():
EXT = '.exe'

TARGET = "gen/main"

JSON = TARGET + ".json"
PCF = TARGET + ".pcf"

Expand All @@ -11,17 +17,17 @@ graph = Builder(action='python build.py $SOURCE',
src_suffix='.json')

# -- Builder 1 (.v --> .blif)
synth = Builder(action='yosys -p \"synth_ice40 -blif $TARGET\" $SOURCE',
synth = Builder(action='yosys{0} -p \"synth_ice40 -blif $TARGET\" $SOURCE'.format(EXT),
suffix='.blif',
src_suffix='.v')

# -- Builder 2 (.blif --> .asc)
pnr = Builder(action='arachne-pnr -d 1k -o $TARGET -p {0} $SOURCE'.format(PCF),
pnr = Builder(action='arachne-pnr{0} -d 1k -o $TARGET -p {1} $SOURCE'.format(EXT, PCF),
suffix='.asc',
src_suffix='.blif')

# -- Builder 3 (.asc --> .bin)
bitstream = Builder(action='icepack $SOURCE $TARGET',
bitstream = Builder(action='icepack{0} $SOURCE $TARGET'.format(EXT),
suffix='.bin',
src_suffix='.asc')

Expand All @@ -33,7 +39,7 @@ blif = env.Synth(TARGET, [ver])
asc = env.PnR(TARGET, [blif, PCF])
binf = env.Bin(TARGET, asc)

upload = env.Alias('upload', binf, 'iceprog ' + ' $SOURCE')
upload = env.Alias('upload', binf, 'iceprog{0} $SOURCE'.format(EXT))
AlwaysBuild(upload)

Default([binf])
4 changes: 2 additions & 2 deletions icestudio/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ angular.module('app', ['flowChart', ])
alertify.error('Build fail');
}
else if (stdout) {
if (stdout.toString().indexOf('error') != -1) {
if (stdout.toString().indexOf('Error') != -1) {
alertify.error('Build fail');
}
else {
Expand All @@ -210,7 +210,7 @@ angular.module('app', ['flowChart', ])
alertify.error('Upload fail');
}
else if (stdout) {
if (stdout.toString().indexOf('error') != -1) {
if (stdout.toString().indexOf('Error') != -1) {
alertify.error('Upload fail');
}
else {
Expand Down
2 changes: 1 addition & 1 deletion icestudio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"keywords": [
"FPGA", "open", "hardware"
],
"version": "0.1-beta1",
"version": "0.1-beta2",
"license" : "GPLv2",
"main": "icestudio.html",
"window": {
Expand Down

0 comments on commit 08a6e32

Please sign in to comment.