FloorPlan Visualizer

This script implements simple floorplanning visualization using SVG images.

The visualizer uses the information stored in each Verilog object (as a PROP) 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 Rect

    • WIDTH and HEIGHT = The rectangular dimension of the module

  • Parameters for cross

    • A, B , C , D , E, F = Dimensions of the rectilinear block (as show in figure below)

  • Parameters for custom

    • It 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

Methods:

__init__

Initialise the class with definition to render.

compose

Entry point to generate final SVG file

add_top_block

Adds top level block in the design

add_symbol

Inserts symbols in the SVG file

add_block

Iterates over each instance and adds them in SVG file

add_stylehseet

Adds custom stylesheet to the SVG image

get_svg

Returns SVG string of the current floorplan

get_html

Adds the SVG image to HTML page which supports zoom and pan control using d3.js

Attributes:

custom_style_sheet

Return custom styles added in this visualiazer

__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>>) svgwrite.drawing.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

add_top_block(top_module)[source]

Adds top level block in the design

add_symbol(module)[source]

Inserts symbols in the SVG file

add_block(instance)[source]

Iterates over each instance and adds them in SVG file

add_stylehseet()[source]

Adds custom stylesheet to the SVG image

get_svg()[source]

Returns SVG string of the current floorplan

get_html()[source]

Adds the SVG image to HTML page which supports zoom and pan control using d3.js