Code Monkey home page Code Monkey logo

polyphony's Introduction

image

image

polyphony

Polyphony is Python based High-Level Synthesis compiler.

Requirements

Python 3.6 or later

Installation

$ pip3 install polyphony

Usage

usage: polyphony [-h] [-o FILE] [-d DIR] [-c CONFIG] [-v] [-D] [-q] [-vd]

[-vm] [-V] source

positional arguments:

source Python source file

optional arguments:

-h, --help show this help message and exit -o FILE, --output FILE output filename (default is "polyphony_out") -d DIR, --dir DIR output directory -c CONFIG, --config CONFIG set configration(json literal or file) -v, --verbose verbose output -D, --debug enable debug mode -q, --quiet suppress warning/error messages -vd, --verilog_dump output vcd file in testbench -vm, --verilog_monitor enable $monitor in testbench -V, --version print the Polyphony version number

Examples

see https://github.com/ktok07b6/polyphony/tree/master/tests

polyphony's People

Contributors

chippiewill avatar ktok07b6 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

Watchers

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

polyphony's Issues

ad7091r.py not working

Traceback (most recent call last):
File "/polyphony/tests/apps/ad7091r.py", line 91, in
test(spic)
File "
/polyphony/polyphony/init.py", line 57, in _testbench_decorator
func(module_instance)
File "/polyphony/polyphony/init.py", line 297, in wrapper
return func(*args, **kwargs)
File "
/polyphony/tests/apps/ad7091r.py", line 86, in test
assert spic.dout() == data & 0x0fff
AssertionError

dout value is 3419

Got an AttributeError on version 0.2.1

Traceback (most recent call last):
  File "/Users/<user>/.virtualenvs/polyphony/bin/polyphony", line 4, in <module>
    main()
  File "/Users/<user>/.virtualenvs/polyphony/lib/python3.6/site-packages/polyphony/compiler/__main__.py", line 395, in main
    compile_main(src_file, options.output_name, options.output_dir, options.debug_mode)
  File "/Users/<user>/.virtualenvs/polyphony/lib/python3.6/site-packages/polyphony/compiler/__main__.py", line 309, in compile_main
    IRTranslator().translate(read_source(src_file))
  File "/Users/<user>/.virtualenvs/polyphony/lib/python3.6/site-packages/polyphony/compiler/irtranslator.py", line 811, in translate
    visitor.visit(tree)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ast.py", line 253, in visit
    return visitor(node)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ast.py", line 261, in generic_visit
    self.visit(item)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ast.py", line 253, in visit
    return visitor(node)
  File "/Users/<user>/.virtualenvs/polyphony/lib/python3.6/site-packages/polyphony/compiler/irtranslator.py", line 196, in visit_FunctionDef
    self.visit(stm)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ast.py", line 253, in visit
    return visitor(node)
  File "/Users/<user>/.virtualenvs/polyphony/lib/python3.6/site-packages/polyphony/compiler/irtranslator.py", line 241, in visit_Return
    self.emit(MOVE(ret, self.visit(node.value)), node)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ast.py", line 253, in visit
    return visitor(node)
  File "/Users/<user>/.virtualenvs/polyphony/lib/python3.6/site-packages/polyphony/compiler/irtranslator.py", line 642, in visit_Call
    if node.starargs:
AttributeError: 'Call' object has no attribute 'starargs'

It does not have the problem on version 0.2.0.

Loop scheduling missing MSTORE/jump dependency

I have a custom array interface implementation that takes 4 steps to complete a write (rather than the default of 2), I'm having issues where if I use it in a loop the the last 2 steps get truncated. I've changed the n_step being used to 4 and the increased the latency of MSTORE and I've traced it back to an issue in the scheduler. It appears that the jump in the forbody back to the fortest does not depend on mstores in the loop body:

Here's the schedule for the block:

Node 6046 0 0:0 @cond565:bool = (i#2:int[32] < @t560:int[32]) @top.const_multiply_fortest2
Node 608c 1 0:1 cjump @cond565:bool ? @top.const_multiply_forbody3, @top.const_multiply_forelse5 @top.const_multiply_fortest2
Node ba6a 0 0:3 @t566:int[32] = ys:list[int[32]][i#2:int[32]] @top.const_multiply_forbody3
Node 459a 0 0:0 i#3:int[32] = (i#2:int[32] + 0x1) @top.const_multiply_forbody3
Node ba5c 1 3:3 t:int[32] = (@t566:int[32] * x:int[32]) @top.const_multiply_forbody3
Node ba4e 2 3:6 mstore(ys:list[int[32]][i#2:int[32]], t:int[32]) @top.const_multiply_forbody3
Node bacc 3 3:4 i#2:int[32] = i#3:int[32] @top.const_multiply_forbody3
Node 45af 4 4:5 jump @top.const_multiply_fortest2 'L' @top.const_multiply_forbody3

You can see that the mstore ends on state 6 but the jump back begins on state 4. The state reducer then removes states 5, 6 because they can't be reached.

compil error IndexError: pop index out of range

hello.
The details.

polyphony xor5.py
Traceback (most recent call last):
  File "c:\users\ore\anaconda3\lib\runpy.py", line 193, in _run_module_as_main    "__main__", mod_spec)
  File "c:\users\ore\anaconda3\lib\runpy.py", line 85, in _run_code    exec(code, run_globals)
  File "C:\Users\ore\Anaconda3\Scripts\polyphony.exe\__main__.py", line 9, in <module>
  File "c:\users\ore\anaconda3\lib\site-packages\polyphony\compiler\__main__.py", line 858, in main    compile_main(options.source, options)
  File "c:\users\ore\anaconda3\lib\site-packages\polyphony\compiler\__main__.py", line 787, in compile_main    compile_results = compile(compile_plan(), main_source, src_file)
  File "c:\users\ore\anaconda3\lib\site-packages\polyphony\compiler\__main__.py", line 780, in compile    driver.run()
  File "c:\users\ore\anaconda3\lib\site-packages\polyphony\compiler\driver.py",line 76, in run    proc(self, s)
  File "c:\users\ore\anaconda3\lib\site-packages\polyphony\compiler\__main__.py", line 380, in constopt_pre_detectrom    ConstantOptPreDetectROM().process(scope)
  File "c:\users\ore\anaconda3\lib\site-packages\polyphony\compiler\constopt.py", line 264, in process    self.visit(stm)
  File "c:\users\ore\anaconda3\lib\site-packages\polyphony\compiler\irvisitor.py", line 31, in visit    return visitor(ir)
  File "c:\users\ore\anaconda3\lib\site-packages\polyphony\compiler\constopt.py", line 176, in visit_CJUMP    self._process_unconditional_cjump(ir, [])
  File "c:\users\ore\anaconda3\lib\site-packages\polyphony\compiler\constopt.py", line 239, in _process_unconditional_cjump    remove_dominated_branch(false_blk)
  File "c:\users\ore\anaconda3\lib\site-packages\polyphony\compiler\constopt.py", line 214, in remove_dominated_branch    phi.args.pop(idx)
IndexError: pop index out of range

(base)

polyphony 0.3.6
Python 3.6.0

The source is this.
https://qiita.com/ohisama@github/items/5b010d66b97f1cf770a6

nice to meet you.

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.