Skip to content

Commit 6dc9f69

Browse files
committed
Update in sync with submodule: prga.py
1 parent 2cb1030 commit 6dc9f69

File tree

11 files changed

+72
-61
lines changed

11 files changed

+72
-61
lines changed

.readthedocs.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ formats: all
1717
python:
1818
version: 3.7
1919
install:
20-
- method: setuptools
20+
- requirements: docs/source/requirements.txt
21+
- method: pip
2122
path: prga.py
2223

2324
# include submoduls for building the docs

docs/source/build_your_custom_fpga.rst

+2-3
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ hierarchical description of CLB/IOB structures. Use
5353

5454
.. code-block:: python
5555
56-
# create IOB
57-
iob = context.create_io_block('iob')
56+
# create IOB: block name, capacity (#blocks per tile)
57+
iob = context.create_io_block('iob', 8)
5858
5959
# create ports of the IOB
6060
clkport = iob.create_global(clk)
@@ -93,7 +93,6 @@ of tile encapsulates an IOB/CLB and the connection boxes around it.
9393
iotiles[orientation] = context.create_tile(
9494
'io_tile_{}'.format(orientation.name), # name of the tile
9595
iob, # IOB/CLB in the tile
96-
8, # number of IOBs in the tile
9796
orientation) # on which side of the FPGA the tile can be placed
9897
9998
`Orientation` is an enum with 5 values: `Orientation.north`, `Orientation.east`,

docs/source/conf.py

+15-11
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@
99
# If extensions (or modules to document with autodoc) are in another directory,
1010
# add these directories to sys.path here. If the directory is relative to the
1111
# documentation root, use os.path.abspath to make it absolute, like shown here.
12-
#
12+
1313
# import os
1414
# import sys
15-
# sys.path.insert(0, os.path.abspath('.'))
16-
15+
# sys.path.insert(0, os.path.abspath('../../prga.py'))
1716

1817
# -- Project information -----------------------------------------------------
1918

@@ -24,7 +23,6 @@
2423
# The full version, including alpha/beta/rc tags
2524
release = 'Alpha 0.3'
2625

27-
2826
# -- General configuration ---------------------------------------------------
2927

3028
# Add any Sphinx extension module names here, as strings. They can be
@@ -52,14 +50,20 @@
5250
# The theme to use for HTML and HTML Help pages. See the documentation for
5351
# a list of builtin themes.
5452
#
55-
html_theme = 'alabaster'
56-
53+
html_theme = 'sphinx_materialdesign_theme'
54+
html_logo = '_static/images/logo.png'
5755
html_theme_options = {
58-
'logo': 'images/logo.png',
59-
'github_user': 'PrincetonUniversity',
60-
'github_repo': 'prga',
61-
'fixed_sidebar': True,
62-
'page_width': "75%",
56+
'header_links' : [
57+
('Home', 'index', False, 'home'),
58+
('Github', "https://github.com/PrincetonUniversity/prga", True, 'link'),
59+
],
60+
'fixed_drawer': True,
61+
'fixed_header': True,
62+
'header_waterfall': True,
63+
'header_scroll': False,
64+
'show_header_title': False,
65+
'show_drawer_title': True,
66+
'show_footer': True,
6367
}
6468

6569
# Add any paths that contain custom static files (such as style sheets) here,

docs/source/index.rst

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ Princeton Reconfigurable Gate Array (PRGA) is a customizable, scalable,
1010
versatile, extensible open-source framework for building and using custom
1111
FPGAs.
1212

13+
Visit PRGA's github repo: `github.com/PrincetonUniversity/prga
14+
<https://github.com/PrincetonUniversity/prga>`_
15+
1316
Features
1417
--------
1518
* Highly customizable FPGA structures: bring your own IP cores, design your

docs/source/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sphinx-materialdesign-theme==0.1.11

envscr/settings.sh

+40-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function find_binary() {
22
binary="$1"
33
shift
4-
$binary -h 2>&1 >/dev/null
4+
/usr/bin/env $binary -h 2>&1 >/dev/null
55
if [ "$?" != 0 ]; then
66
echo "[Error] Binary not found: $binary"
77
echo $@
@@ -10,24 +10,54 @@ function find_binary() {
1010
return 0
1111
}
1212

13+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/.. >/dev/null && pwd )"
14+
CWD=$PWD
15+
cd $DIR/envscr
16+
17+
echo "[INFO] Checking the presence of Python Interpreter"
18+
find_binary python "Check out Python from https://www.python.org/"
19+
retval=$?
20+
if [ "$retval" != 0 ]; then return $retval 2>/dev/null; exit $retval; fi
21+
22+
echo "[INFO] Checking the presence of PIP"
23+
python -m pip 2>&1 >/dev/null
24+
retval=$?
25+
if [ "$?" != 0 ]; then
26+
echo "[Error] Python module not found: pip"
27+
echo "Checkout PIP from: https://pypi.org/project/pip/"
28+
return $retval 2>/dev/null
29+
exit $retval
30+
fi
31+
32+
echo "[INFO] Checking if prga.py is installed"
33+
python -c "from __future__ import absolute_import; import prga" 2>&1 >/dev/null
34+
retval=$?
35+
if [ "$retval" != 0 ]; then
36+
echo "[INFO] Installing prga.py"
37+
python -m pip install -e $DIR/prga.py --user
38+
fi
39+
40+
echo "[INFO] Checking the presence of VPR"
1341
find_binary vpr "Check out VPR from " \
1442
"https://github.com/verilog-to-routing/vtr-verilog-to-routing, " \
1543
"compile it and find 'vpr' under \$VTR_ROOT/vpr/"
16-
if [ "$?" != 0 ]; then exit 1; fi
44+
retval=$?
45+
if [ "$retval" != 0 ]; then return $retval 2>/dev/null; exit $retval; fi
1746

47+
echo "[INFO] Checking the presence of VPR utility: genfasm"
1848
find_binary genfasm "Check out VPR from " \
1949
"https://github.com/verilog-to-routing/vtr-verilog-to-routing, " \
2050
"compile it and find 'genfasm' under \$VTR_ROOT/build/utils/fasm/"
21-
if [ "$?" != 0 ]; then exit 1; fi
51+
retval=$?
52+
if [ "$retval" != 0 ]; then return $retval 2>/dev/null; exit $retval; fi
2253

23-
find_binary "yosys" "Check out Yosys from " \
54+
echo "[INFO] Checking the presence of yosys"
55+
find_binary yosys "Check out Yosys from " \
2456
"http://www.clifford.at/yosys/, compile and install it"
25-
if [ "$?" != 0 ]; then exit 1; fi
57+
retval=$?
58+
if [ "$retval" != 0 ]; then return $retval 2>/dev/null; exit $retval; fi
2659

2760
rm vpr_stdout.log
61+
cd $CWD
2862

29-
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/.. >/dev/null && pwd )"
30-
export PRGA_ROOT=$DIR
31-
if [[ ":$PYTHONPATH:" != *":$DIR/prga.py:"* ]]; then
32-
export PYTHONPATH="$DIR/prga.py${PYTHONPATH:+":$PYTHONPATH"}"
33-
fi
63+
echo "[INFO] Environmental setup succeeded!"

examples/fpga/medium/frac_k6_N4_mem8K_42x34/build.py

+2-11
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,13 @@ def run():
1717
context.create_segment('L4', 8, 4)
1818

1919
# 2. create IOB
20-
iob = context.create_io_block('iob')
20+
iob = context.create_io_block('iob', 8)
2121
while True:
22-
clkport = iob.create_global(clk)
2322
outpad = iob.create_input('outpad', 1)
2423
inpad = iob.create_output('inpad', 1)
2524
ioinst = iob.instances['io']
26-
iff = iob.instantiate(context.primitives['flipflop'], 'iff')
27-
off = iob.instantiate(context.primitives['flipflop'], 'off')
28-
iob.connect(clkport, iff.pins['clk'])
29-
iob.connect(ioinst.pins['inpad'], iff.pins['D'])
30-
iob.connect(iff.pins['Q'], inpad)
3125
iob.connect(ioinst.pins['inpad'], inpad)
32-
iob.connect(clkport, off.pins['clk'])
33-
iob.connect(off.pins['Q'], ioinst.pins['outpad'])
3426
iob.connect(outpad, ioinst.pins['outpad'])
35-
iob.connect(outpad, off.pins['D'])
3627
break
3728

3829
# 3. create tile
@@ -41,7 +32,7 @@ def run():
4132
if orientation.is_auto:
4233
continue
4334
iotiles[orientation] = context.create_tile(
44-
'io_tile_{}'.format(orientation.name), iob, 8, orientation)
35+
'io_tile_{}'.format(orientation.name), iob, orientation)
4536

4637
# 5. create CLB
4738
clb = context.create_logic_block('clb')

examples/fpga/tiny/frac_k6_N2_8x8/build.py

+2-11
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,13 @@ def run():
1313
context.create_segment('L2', 4, 2)
1414

1515
# 2. create IOB
16-
iob = context.create_io_block('iob')
16+
iob = context.create_io_block('iob', 4)
1717
while True:
18-
clkport = iob.create_global(clk)
1918
outpad = iob.create_input('outpad', 1)
2019
inpad = iob.create_output('inpad', 1)
2120
ioinst = iob.instances['io']
22-
iff = iob.instantiate(context.primitives['flipflop'], 'iff')
23-
off = iob.instantiate(context.primitives['flipflop'], 'off')
24-
iob.connect(clkport, iff.pins['clk'])
25-
iob.connect(ioinst.pins['inpad'], iff.pins['D'])
26-
iob.connect(iff.pins['Q'], inpad)
2721
iob.connect(ioinst.pins['inpad'], inpad)
28-
iob.connect(clkport, off.pins['clk'])
29-
iob.connect(off.pins['Q'], ioinst.pins['outpad'])
3022
iob.connect(outpad, ioinst.pins['outpad'])
31-
iob.connect(outpad, off.pins['D'])
3223
break
3324

3425
# 3. create tile
@@ -37,7 +28,7 @@ def run():
3728
if orientation.is_auto:
3829
continue
3930
iotiles[orientation] = context.create_tile(
40-
'io_tile_{}'.format(orientation.name), iob, 4, orientation)
31+
'io_tile_{}'.format(orientation.name), iob, orientation)
4132

4233
# 5. create CLB
4334
clb = context.create_logic_block('clb')

examples/fpga/tiny/frac_k6_N2_mem8K_8x8/build.py

+2-11
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,13 @@ def run():
1313
context.create_segment('L2', 4, 2)
1414

1515
# 2. create IOB
16-
iob = context.create_io_block('iob')
16+
iob = context.create_io_block('iob', 4)
1717
while True:
18-
clkport = iob.create_global(clk)
1918
outpad = iob.create_input('outpad', 1)
2019
inpad = iob.create_output('inpad', 1)
2120
ioinst = iob.instances['io']
22-
iff = iob.instantiate(context.primitives['flipflop'], 'iff')
23-
off = iob.instantiate(context.primitives['flipflop'], 'off')
24-
iob.connect(clkport, iff.pins['clk'])
25-
iob.connect(ioinst.pins['inpad'], iff.pins['D'])
26-
iob.connect(iff.pins['Q'], inpad)
2721
iob.connect(ioinst.pins['inpad'], inpad)
28-
iob.connect(clkport, off.pins['clk'])
29-
iob.connect(off.pins['Q'], ioinst.pins['outpad'])
3022
iob.connect(outpad, ioinst.pins['outpad'])
31-
iob.connect(outpad, off.pins['D'])
3223
break
3324

3425
# 3. create tile
@@ -37,7 +28,7 @@ def run():
3728
if orientation.is_auto:
3829
continue
3930
iotiles[orientation] = context.create_tile(
40-
'io_tile_{}'.format(orientation.name), iob, 4, orientation)
31+
'io_tile_{}'.format(orientation.name), iob, orientation)
4132

4233
# 5. create CLB
4334
clb = context.create_logic_block('clb')

examples/fpga/tiny/k4_N2_8x8/build.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def run():
1414
context.create_segment('L1', 12, 1)
1515

1616
# 2. create IOB
17-
iob = context.create_io_block('iob')
17+
iob = context.create_io_block('iob', 4)
1818
while True:
1919
outpad = iob.create_input('outpad', 1)
2020
inpad = iob.create_output('inpad', 1)
@@ -29,7 +29,7 @@ def run():
2929
if orientation.is_auto:
3030
continue
3131
iotiles[orientation] = context.create_tile(
32-
'io_tile_{}'.format(orientation.name), iob, 4, orientation)
32+
'io_tile_{}'.format(orientation.name), iob, orientation)
3333

3434
# 4. create cluster
3535
cluster = context.create_cluster('cluster')

0 commit comments

Comments
 (0)