FloorPlan Visualizer¶
This script implements simple floorplanning visualization using SVG images.
The visualizer uses the information stored in each Verilog object to perform shaping and placement of each block. but there is no explicit routing performed, all the edges are connected from point to point.
Detail of properties of different objects
On Definitions
SHAPE = Shape of the module [Rect (Default), cross, custom]
Parameters for
RectWIDTHandHEIGHT= The rectangular dimension of the module
Parameters for
crossA,B,C,D,E,F= Dimensions of the rectilinear block (as show in figure below)
Parameters for
customIt is represented by a sequence of numbers <Start_direction(V/H)> <FirstPoint (int int)> <Sequence of vertical and horizontal distance>, and the last point connects to the start point automatically
For example following example creates rectangle: V 0 0 10 20 20
d
┌──────────┐
│ │
c│ │
b │ │ e
┌──────┘ └──────┐
│ │
a│ │
│ │
└──────┐ ┌──────┘
│ │
f│ │
│ │
└──────────┘
cross Shape
On Instances
LOC_X and LOC_Y = Location of the component with respect to its parent
Ports Placement:
SIDE:
Shape size where module port is placed [left/right/bottom/top]
SIDE2:
Optional and valid only when shape in cross [left/right/bottom/top]
OFFSET:
Offset from the origin of that side
The first point on the respective side in a clockwise direction is considered as the origin
top/top
┌──────────┐
top/left │ | top/right
│ │
left/top │ │ right/top
┌──────┘ └──────┐
│ │
left/left │ 0 │ right/right
│ │
└──────┐ ┌──────┘
left/bottom │ │ right/bottom
│ │
bottom/left │ | bottom/right
└──────────┘
bottom/bottom
Representing SIDE/SIDE2 parameters
TODO Add Some sort of coordinate transformation which scaleX and scaleY. All the inputs are in multiple SC_HEIGHT and SC_WIDTH, a default value of these variables is set to 1
Overview¶
- class spydrnet_physical.util.FloorPlanViz(definition, viewbox=(0, 0, 1000, 1000))[source]¶
Implmenetation of SVG Visualiser floorplan_visualizer
Attributes:
PIN_HPIN_Wcustom_style_sheetReturn custom styles added in this visualiazer
Methods:
__init__Initialise the class with definition to render.
composeEntry point to generate final SVG file
add_top_blockAdds top level block in the design
add_symbolInserts symbols in the SVG file
add_blockIterates over each instance and adds them in SVG file
add_stylehseetAdds custom stylesheet to the SVG image
get_svgReturns SVG string of the current floorplan
get_htmlAdds the SVG image to HTML page which supports zoom and pan control using d3.js
- __init__(definition, viewbox=(0, 0, 1000, 1000))[source]¶
Initialise the class with definition to render.
Optionally, provide the Height and Width if its not set on the definition itself
- property custom_style_sheet¶
Return custom styles added in this visualiazer
- compose(skip_connections=False, skip_pins=False, filter_cables=<function FloorPlanViz.<lambda>>) Drawing[source]¶
Entry point to generate final SVG file
- Parameters:
skip_connections (bool) – Skip rednering connections beetween modules
skip_pins (bool) – Skip rendering modules pins
filter_cables (Callable) – A callable function which filters the connections to redner