Code Monkey home page Code Monkey logo

apio's People

Contributors

aalku avatar benitoss avatar cavearr avatar counterpillow avatar esden avatar flabbergast avatar gshrikant avatar himarcarmona avatar jesus89 avatar jmi2k avatar jojo535275 avatar jpenalbae avatar kirk-clendinning avatar luongb avatar mmicko avatar obijuan avatar pcossutta avatar peque avatar pitrz avatar s-ol avatar seanybaggins avatar set-soft avatar suzuki-naoto avatar tilk avatar vr2045 avatar wifiboyderek avatar will-hut avatar x653 avatar xesxen avatar zapta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apio's Issues

Implement the apio debug lsusb command

This apio command will list the USB devices
It invokes the listdevs binary, located in the packages tools-usb-ftdi (that is intalled by means of the apio debug install command)

Implement apio debug install

The "apio debug install" command will download and install the package tools-usb-ftdi

This package contains the binaries for the utilities listdevs and find_all. The first one is for listing all the USB devices. The second is for showing the boards with FTDI chips

These binaries are invoke using the apio commands:

  • apio debug lsusb ---> listdevs
  • apio debug lsftdi --> find_all

[Feature] Add variable board to SConstruct

The variable board will be used in the SConstruct file for building the verilog files for the specified board
Ex:
scons board=icestick

Current board values will be: icestick, icezum, go-board

If the variable board is set, it will override other fpga flags passed:

Ex:
scons board=icezum fpga_size=8k

It won't set the fpga_size to 8k, because it will use the one determined for the icezum board (1k)

[Bug] examples Makefile

Case:

apio examples -f Makefile
apio examples -d Makefile

or

apio examples -d Makefile
apio examples -f Makefile

Crashes because directory and file have the same name. New checks have to be included.

[Feature] Multiboard support in apio

Currently (apio version 0.1.0.2) only supports boards based on lattice ice40hx 1k and tq144 (ex. Icezum Alhambra, icestick). For supporting other boards, like nandland go, some flags should be passed to apio when synthesizing.

We should think about how to include this multiboard support. The approach can be similar to apio: use a command for creating a project which includes a project.json file that is read by apio for synthetizing to the target board

Ex:

apio project icezum

It will generate the project.json file in the current directory (aditionally some template files can also be added, like a icezum.pcf constraint file for example)

The algorithm for building could be something like:
$ apio build

  1. If SConstruct file exist: Use it for building. Exit
  2. Look for the project.json file in the current dir
  3. If project.json does not exist
    2.1 use the flags for the default board (icezum for example)
    2.2 Build it and exit
  4. Read the flags in the project.json: Size (1k, 8k), Pack (tq144, ct256...), family (iCE40), subfamily (HX, LP)
  5. Pass this flags to the default SConstruct file (etither by command or by environmental variable)
  6. Build

Task to be done:

  1. Define the flags needed
  2. Create a new SConstruct file that implements this flags
  3. Define the project.json file (or board.json or whatever we call it)
  4. Implement the command apio project (or whatever name we use for it). It just generates the platform.json file
  5. Implement the new apio builld command

I will learn more about the flags needed. Initially I will create a generic makefile and integrate it into apio as an example: apio examples -f makefile). This is just a legacy example. It will let us compile easily examples that have already been created (like the ones in the verilog tutorials). Then I will create a generic SConstruct file, compatible with the current one, with the flags defined in the begining. Using apio init this file can be obtained and the user can set manually the building flags. Once it is working, we can integrate it with the new building system

[Feature] Include the option --sayno to the apio examples command

If during the copying of the examples files there exist a file with the same name, apio ask the user if it can overwrite that file.

With the opcion --sayno the answer is always no, and no questions are asked. This is needed in apio-ide. In apio-ide we do not want the apio back-end to ask questions on the console

[Upgrade] Add pio-fgpa releases

Use same scons, system packages method to install pio-fpga. Using a separated repository with releases.
Then, PiofpgaInstaller must inherit from Installer.

Implement the toolchain for the AGC

Create the toolchain for the AGC (Apollo Guide Computer), multiplatform. Give support in Apio

It is located in this repo

The needed tools are:

  • yaYUL --> AGC asembler
  • yaAGC --> Simulator
  • acc-rom --> Generate the rom.list in Verilog (in the ACC repo)

Problems with scons

When I use "verify" o "build" or anything that uses scons, I get

➜  leds git:(master) ✗ apio build
Info: use apio.ini board: icezum
Using default SConstruct file
[Tue Nov 29 10:03:32 2016] Processing icezum
--------------------------------------------------------------------------------
scons: *** SCons version 2.4.1 does not run under Python version 3.5.2.
Python 3 is not yet supported.

In fact, it's not using the system-wide Scons, which is upgraded to 2.5.1, supposed to work with Python3. I have edited apio and simply changed it to "python" instead of Python3 and it does not work.

[Feature] add --project-dir option to apio init

The command:

$ apio init

creates the apio.ini file in the current directory. If the --project-dir flag is given, it will be generated in that directory. This option is needed for the project initialization in apio-ide

[Example] Makefile example

Implement the Makefile example:

apio examples -f Makefile (or -d)

This is a legacy example, for easily obtaining a working makefile and sythesizing in the old way:

(For example, for the verilog tutorials)

$ apio examples -f Makefile
make sint
make upload

Some users are very familiar with the make system

This is not the recomended way of building, but it is included as legacy
It can be considered an option for advanced users

The Makefile should include flags for building for all the supported FPGAs, described in the icestorm project

[Feature] Implement the option --project-dir in the apio examples command

The apio examples command, by deault, copy the files to the current working directory. If the --project-dir dir option is specify, they are copied to that directory instead of the current

This option is neccessary for the apio-ide to open the examples (It will be used in the 0.4.0 release)

Implements the apio debug lsftdi command

This apio command will list the FTDI devices
It invokes the find_all binary, located in the package tools-usb-ftdi (that is intalled by means of the apio debug install command)

[Feature] Include a short description when listing the examples

The command:

apio examples -l

Generates a list of all the examples available. It would be great if every example has a short description

Ex. Currentle the output is:

$ apio examples -l

Makefile
icestick
leds
wire
[..]

It would be great if the output were something like:

$ apio examples -l

Makefile Generic Makefile for building projects (legacy)
icestick Icestick board constraint file
leds Verilog example for Turning all the leds on (for the icestick / icezum boards)
wire Verilog example on how to describe a simple wire

The question is: Were can be this short string be stored?

[Feature] Add fpga flags to the build command

Ex: apio build --pack vq100

It will build the current example seting the scons fpga vairable fpga_pack to vq100

(Internally it will call scons with: scons fpga_pack=vq100)

The supported build flags are: --pack, --size and --type, corresponding to the fpga_pack, fpga_size and fpga_type scons flags

This is an advanced feature. Normal user will create a proyect first indiating the board type and then build it using plain apio build. But allowing to change the flags directly is very usefull for easily testing new boards

Implement the opcion -f in the apio examples command

Ej.

$ apio examples -f leds
$ ls
leds.v leds.pcf leds_on_tb.v leds_on_tb.gtw

It will make it easier the use of apio with platformio as well as merging different verilog entities easily in the same project:

$ apio examples -f uart
$ apio examples -f servos

Error when executing the command apio install --system in Linux-64

Apio has been installed in a virtualenv
The error message is:

$ apio install --system
Traceback (most recent call last):
  File "/home/obijuan/venvs/pio1/bin/apio", line 11, in <module>
    sys.exit(cli())
  File "/home/obijuan/venvs/pio1/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/obijuan/venvs/pio1/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/obijuan/venvs/pio1/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/obijuan/venvs/pio1/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/obijuan/venvs/pio1/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/obijuan/venvs/pio1/local/lib/python2.7/site-packages/apio/__init__.py", line 64, in install
    SystemInstaller().install()
  File "/home/obijuan/venvs/pio1/local/lib/python2.7/site-packages/apio/packages/system.py", line 20, in __init__
    self.version = self._get_version()
  File "/home/obijuan/venvs/pio1/local/lib/python2.7/site-packages/apio/packages/system.py", line 54, in _get_version
    version = releases['tag_name'].split('.')[1]  # v0.X -> X
KeyError: 'tag_name'

Apio version:

$ apio --version
apio, version 0.0.5

[Feature] Add a hint when the example is not found

When an example is not found, this error message is gotten:

$ apio examples -f wrongexample
Sorry, this example does not exist

It would be great if the error message was something like:
Sorry, this example does not exist
Use "apio examples -l" for listing all the available examples

libffi not found

libffi is not installed by default on MacOS Sierra:
dyld: Library not loaded: /usr/local/opt/libffi/lib/libffi.6.dylib
Referenced from: /Users/sonium/.apio/packages/toolchain-icestorm/bin/yosys
Reason: image not found
scons: *** [hardware.blif] Error -6

This can however be fixed easily by 'brew install libffi'.

Add support to the Kefir ICE40-4K board

Kéfir is a openhardware board developed by Salvador Eduardo Tropea, with an ice40-4K FPGA

The parameters for working with icestorm are:

yosys -q -p "synth_ice40 -blif rot.blif" rot.v
arachne-pnr -d 8k -P tq144:4k -p rot.pcf rot.blif -o rot.asc
iceprog -I B rot.bin

Remove Python 2 dependency

It seems the only thing preventing full Python 3 compatibility is SCons. Maybe it could be replaced by another Python build system (perhaps WAF?).

Add native bin flags

$ apio config
Usage: apio config [OPTIONS]

Apio configuration.

Options:
-l, --list List all configuration parameters.
-e, --exe [apio|native] Configure executables: apio selects apio
packages, native selects system binaries
--help Show this message and exit.

$ apio config --exe apio
Executable mode updated: apio

$ apio config --exe native
Executable mode updated: native

$ apio config --list
Executable mode: native

Native mode does not require packages. It executes native binaries instead. A variable is stored in the apio profile.json.

[GNU/Linux] `apio drivers --enable` fails if `sudo` is not installed.

For example, on Ubuntu without sudo:

# apt-get update && apt-get install -y python python-pip \
 && pip install -U pip apio \
 && apio drivers --enable \
 && apio install --all

throws the following error:

Configure FTDI drivers for FPGA
Traceback (most recent call last):
  File "./root/.local/bin/apio", line 11, in <module>
    sys.exit(cli())
  File "/root/.local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/root/.local/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/root/.local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/root/.local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/root/.local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/root/.local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/root/.local/lib/python2.7/site-packages/apio/commands/drivers.py", line 24, in cli
    exit_code = Drivers().enable()
  File "/root/.local/lib/python2.7/site-packages/apio/managers/drivers.py", line 52, in enable
    return self._enable_linux()
  File "/root/.local/lib/python2.7/site-packages/apio/managers/drivers.py", line 78, in _enable_linux
    self.rules_local_path, self.rules_system_path])
  File "/usr/lib/python2.7/subprocess.py", line 523, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

I think that the problem might be at managers/drivers.py:

def _enable_linux(self):
click.secho('Configure FTDI drivers for FPGA')
if not isfile(self.rules_system_path):
subprocess.call(['sudo', 'cp',
self.rules_local_path, self.rules_system_path])
subprocess.call(['sudo', 'service', 'udev', 'restart'])

If apio drivers --enable is run as root, sudo is not required. Furthermore, shall it not be available, trying to use it throws an error. I'd expect apio to check whether sudo is required, prior to using it.


On top of that, if Ubuntu is a docker container, restarting udev won't work. However, I have not looked in depth into this. So, I don't know which the best approach would be: whether not to run that command and show a message instead, or replace drivers --enable as a whole and show a longer message. You can have a look at this question: http://stackoverflow.com/questions/36880565/why-dont-my-udev-rules-work-inside-of-a-running-docker-container

[Feature] New apio scons command

The apio init command generates the SConstruct, so that the user can change/modify it

For multiboard support, it is better to use the init comand for creating a new project, the same as platformio do:

apio init --board icestick

For that reason, the current apio init behaviour should be moved to apio scons:

apio scons --> It will generate the default SConstruct file
apio init --> It will create the apio.ini file, with the project configuration: board, name, and so on...

apio verify

Implement apio verify (using iverilog) and the iverilog installer.

[BUG] apio should return error codes

In order for the atom build command to detect if the an apio build has succeed or not, apio should return error code (an error code diferent from 0 means no success)

It can be checked in the bash with the $? systema variable:

$ apio build
$ echo $?
0

Apio always return 0 (if does not matter if there was an error when building)

On the contrary, pio returns 0 when the build success, or any other code different than zero if the was an error

Ex:
$ pio run
Error: Not a PlatformIO project. platformio.ini file has not been found in current working directory (/home/obijuan/develop/test/pio1/src). To initialize new project please use platformio init command
$ echo $?
1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.