Skip to content

Commit 5446980

Browse files
committed
designs/asap7/mock-big-array: more configurable testcase
Signed-off-by: Øyvind Harboe <[email protected]>
1 parent e684b19 commit 5446980

File tree

21 files changed

+1087
-981
lines changed

21 files changed

+1087
-981
lines changed

flow/designs/asap7/mock-array-big/Element/config.mk

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ export SDC_FILE = designs/asap7/mock-array-big/constraints.sdc
77
export PLATFORM = asap7
88

99
export PLACE_DENSITY = 0.40
10-
export CORE_UTILIZATION = 20
11-
export CORE_ASPECT_RATIO = 1
12-
export CORE_MARGIN = 2
10+
export CORE_AREA = $(shell python3 designs/asap7/mock-array-big/ce_core_area.py)
11+
export DIE_AREA = $(shell python3 designs/asap7/mock-array-big/ce_die_area.py)
1312

1413
export IO_CONSTRAINTS = designs/asap7/mock-array-big/Element/io.tcl
14+
15+
export MACRO_PLACE_HALO = 1 1

flow/designs/asap7/mock-array-big/Element/io.tcl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ proc pin1 {fmt p} {
66
return $result
77
}
88

9-
set data_width 8
9+
set data_width [expr {[info exists ::env(MOCK_ARRAY_DATAWIDTH)] ? $::env(MOCK_ARRAY_DATAWIDTH) : 8}]
10+
1011
set assignments [list \
1112
top bottom \
1213
[list [ concat \
@@ -44,3 +45,5 @@ foreach {direction direction2 names} $assignments {
4445
set_io_pin_constraint -region $direction2:* -pin_names [lindex $names 1]
4546
set_io_pin_constraint -mirrored_pins $mirrored
4647
}
48+
49+
set_io_pin_constraint -region top:* -pin_names clock
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Mock array big
2+
==============
3+
4+
A mock array that can be configured in different sizes to generate
5+
interesting test-cases.
6+
7+
By default, the array is 8x8 elements and has an 8 bit datapath.
8+
9+
To create a 4x4 element array with 4 bit datapath, run:
10+
11+
MOCK_ARRAY_WIDTH=4 MOCK_ARRAY_HEIGHT=4 MOCK_ARRAY_DATAWIDTH=4 ./configure.sh
12+
MOCK_ARRAY_WIDTH=4 MOCK_ARRAY_HEIGHT=4 MOCK_ARRAY_DATAWIDTH=4 make DESIGN_CONFIG=designs/asap7/mock-array-big/config.mk
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import config
2+
3+
print(f'1 1 {config.element_width - 1} {config.element_height - 1}')
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import config
2+
3+
print(f'0 0 {config.element_width} {config.element_height}')

flow/designs/asap7/mock-array-big/config.mk

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ export PLATFORM = asap7
1010

1111
export PLACE_DENSITY = 0.30
1212

13-
export CORE_UTILIZATION = 20
14-
export CORE_ASPECT_RATIO = 1
15-
export CORE_MARGIN = 2
13+
export CORE_AREA = $(shell python3 designs/asap7/mock-array-big/core_area.py)
14+
export DIE_AREA = $(shell python3 designs/asap7/mock-array-big/die_area.py)
1615

1716
BLOCKS = Element
1817

@@ -22,4 +21,4 @@ export MACRO_PLACEMENT = ./designs/asap7/mock-array-big/macro-placement.cfg
2221

2322
export IO_CONSTRAINTS = designs/asap7/mock-array-big/io.tcl
2423

25-
export MACRO_PLACE_HALO = 2 2
24+
export MACRO_PLACE_HALO = 1 1
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# see flow/platforms/asap7/openRoad/pdn/grid_strategy-M2-M5-M7.tcl
2+
import os
3+
4+
rows = int(os.environ.get("MOCK_ARRAY_HEIGHT", "8"))
5+
cols = int(os.environ.get("MOCK_ARRAY_WIDTH", "8"))
6+
pitch_scale = int(os.environ.get("MOCK_ARRAY_PITCH_SCALE", "10"))
7+
8+
9+
# from platforms/asap7/openRoad/make_tracks.tcl, smallest common x_pitch and y_pitch
10+
# denominator
11+
lowest_common_grid_denominator = 0.576
12+
13+
power_x_pitch = 4 * lowest_common_grid_denominator
14+
power_y_pitch = 4 * lowest_common_grid_denominator
15+
y_pitch = (power_y_pitch * pitch_scale)
16+
x_pitch = (power_x_pitch * pitch_scale)
17+
offset_x = power_x_pitch * 4
18+
offset_y = power_y_pitch * 4
19+
margin = 4 * lowest_common_grid_denominator
20+
21+
element_width = x_pitch - power_x_pitch * 4
22+
element_height = y_pitch - power_y_pitch * 4
23+
24+
height = rows * y_pitch + offset_y
25+
width = cols * x_pitch + offset_x
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
set -ex
3+
4+
# allow this script to be invoked from any folder
5+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
6+
BASE=$DIR/../..
7+
8+
cd $DIR
9+
10+
python3 placement.py >macro-placement.cfg
11+
12+
cd ../../src/mock-array-big
13+
14+
sbt -Duser.home="$HOME" -Djline.terminal=jline.UnsupportedTerminal -batch \
15+
"test:runMain GenerateMockArray --width ${MOCK_ARRAY_WIDTH:-8} --height ${MOCK_ARRAY_HEIGHT:-8} --dataWidth ${MOCK_ARRAY_DATAWIDTH:-8} -- --emit-modules verilog --target-dir ."

flow/designs/asap7/mock-array-big/constraints.sdc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
set sdc_version 2.0
2-
create_clock [get_ports clock] -period 250 -waveform {0 125}
2+
3+
set clk_period 8000
4+
create_clock [get_ports clock] -period $clk_period -waveform [list 0 [expr $clk_period/2]]
35

46
set clk_name clock
57
set clk_port_name clock
6-
set clk_period 250
78
set clk_io_pct 0.2
89

910
set clk_port [get_ports $clk_port_name]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import config
2+
3+
x = config.margin
4+
y = config.margin
5+
6+
print(f'{y} {x} {x+config.width} {y+config.height}')

0 commit comments

Comments
 (0)