Hurricane VLSI Database


List of all members | Public Types | Static Public Member Functions
Hurricane::DbU Class Reference

DataBase Unit managment (API). More...

Public Types

enum  StringMode {
  Db = (1<<0) ,
  Grid = (1<<1) ,
  Symbolic = (1<<2) ,
  Physical = (1<<3) ,
  SmartTruncate = (1<<4)
}
 
typedef std::int64_t Unit
 

Static Public Member Functions

static Unit fromDb (Unit value)
 
static Unit fromGrid (double value)
 
static Unit fromLambda (double value)
 
static Unit fromPhysical (double value, UnitPower p)
 
static unsigned int getPrecision ()
 
static unsigned int getMaximalPrecision ()
 
static double getResolution ()
 
static void setPrecision (unsigned int precision, unsigned int flags=NoFlags)
 
static void setGridsPerLambda (double gridsPerLambda, unsigned int flags=NoFlags)
 
static double getGridsPerLambda ()
 
static DbU::Unit getRealSnapGridStep ()
 
static DbU::Unit getOnRealSnapGrid (DbU::Unit u, SnapMode mode=Nearest)
 
static void setRealSnapGridStep (DbU::Unit step)
 
static DbU::Unit getSymbolicSnapGridStep ()
 
static DbU::Unit getOnSymbolicSnapGrid (DbU::Unit u, SnapMode mode=Nearest)
 
static void setSymbolicSnapGridStep (DbU::Unit step)
 
static DbU::Unit getOnCustomGrid (DbU::Unit u, DbU::Unit step, SnapMode mode=Nearest)
 
static DbU::Unit getOnPhysicalGrid (DbU::Unit u, SnapMode mode=Superior)
 
static Unit toDb (Unit u)
 
static double toGrid (Unit u)
 
static double toLambda (Unit u)
 
static double toPhysical (Unit u, UnitPower p)
 
static string getValueString (Unit u, int mode=SmartTruncate)
 
static void setStringMode (unsigned int mode, UnitPower p=Nano)
 

Obsoleteds

Due to their somewhat unclear naming convention, those functions have been renamed by the to / from variants.

enum  UnitPower {
  Pico = 1 ,
  Nano ,
  Micro ,
  Milli ,
  Unity ,
  Kilo
}
 
enum  SnapMode {
  Inferior = 1 ,
  Superior = 2 ,
  Nearest = 4
}
 
static Unit db (Unit value)
 
static Unit grid (double value)
 
static Unit lambda (double value)
 
static Unit getDb (Unit u)
 
static double getGrid (Unit u)
 
static double getLambda (Unit u)
 

Detailed Description

DataBase Unit managment (API).

Explanations about this class are here DbU/Unit description.

Member Typedef Documentation

◆ Unit

The working DataBase type for storing dimensions.

Member Enumeration Documentation

◆ UnitPower

This enumeration defines the power applicable to physical units.

Enumerator
Pico 

10e-12

Nano 

10e-9

Micro 

10e-6

Milli 

10e-3

Unity 

1

Kilo 

10e+3

◆ StringMode

Select how units are to be printed by getValueString().

Enumerator
Db 

Units are printed "as is", their true value as stored in the DataBase.

Grid 

Units are printed as founder grid steps.

Symbolic 

Units are printed as symbolic (lambdas).

◆ SnapMode

This enumeration defines the rounding applicable to the grid management functions.

Enumerator
Inferior 

Round to the inferior grid point.

Superior 

Round to the superior grid point.

Nearest 

Round nearest grid point, inferior or superior depending on the distance.

Member Function Documentation

◆ fromDb()

DbU::Unit Hurricane::DbU::fromDb ( DbU::Unit  value)
inlinestatic

Returns: the unit corresponding to the value <value> according to the current precision. This function do nothing apart from a cast.

Referenced by db().

◆ fromGrid()

DbU::Unit Hurricane::DbU::fromGrid ( double  value)
inlinestatic

Returns: the unit corresponding to the grid value <value> according to the current precision.

Referenced by fromLambda(), fromPhysical(), and grid().

◆ fromLambda()

DbU::Unit Hurricane::DbU::fromLambda ( double  value)
inlinestatic

Returns: the unit corresponding to the symbolic value <value> according to the current precision.

References fromGrid().

Referenced by lambda().

◆ fromPhysical()

DbU::Unit Hurricane::DbU::fromPhysical ( double  value,
UnitPower  p 
)
inlinestatic

Returns: the unit corresponding to the physical value <value> with power p, according to the current precision.

References fromGrid().

◆ db()

DbU::Unit Hurricane::DbU::db ( DbU::Unit  value)
inlinestatic

Returns: the unit corresponding to the value <value> according to the current precision. This function do nothing apart from a cast.

References fromDb().

◆ grid()

DbU::Unit Hurricane::DbU::grid ( double  value)
inlinestatic

Returns: the unit corresponding to the grid value <value> according to the current precision.

References fromGrid().

Referenced by getOnPhysicalGrid().

◆ lambda()

DbU::Unit Hurricane::DbU::lambda ( double  value)
inlinestatic

Returns: the unit corresponding to the symbolic value <value> according to the current precision.

References fromLambda().

◆ getPrecision()

unsigned Hurricane::DbU::getPrecision ( )
static

Returns: the current precision (whose default is fixed to 1).

◆ getMaximalPrecision()

unsigned Hurricane::DbU::getMaximalPrecision ( )
static

Returns: the maximal precision allowed (currently fixed to 3).

◆ getResolution()

double Hurricane::DbU::getResolution ( )
static

Returns: the current resolution.

◆ setPrecision()

void Hurricane::DbU::setPrecision ( unsigned int  precision,
unsigned int  flags = NoFlags 
)
static

Allows to set the precision at a requested value. This must be done at the begining of the program (before the creation of the first unit) and not changed for the following (unless mandatory and for a temporary period because all existing units would be misinterpreted).

Remarks
This function throws an exception if the requested precision is greater than the maximal one.

◆ setGridsPerLambda()

void Hurricane::DbU::setGridsPerLambda ( double  gridsPerLambda,
unsigned int  flags = NoFlags 
)
static

Returns: Sets how many founder grid steps makes one lambda. It must be an event integer otherwise an exception is thrown.

◆ getGridsPerLambda()

double Hurricane::DbU::getGridsPerLambda ( )
static

Returns: How many founder grid steps makes one lambda.

◆ getRealSnapGridStep()

DbU::Unit Hurricane::DbU::getRealSnapGridStep ( )
static

Get the real (founder) grid step.

◆ getOnRealSnapGrid()

DbU::Unit Hurricane::DbU::getOnRealSnapGrid ( DbU::Unit  u,
DbU::SnapMode  mode = Nearest 
)
static

Get the snap point from the unit u, using the rounding mode mode.

◆ setRealSnapGridStep()

void Hurricane::DbU::setRealSnapGridStep ( DbU::Unit  step)
inlinestatic

Set the real (founder) grid step.

◆ getSymbolicSnapGridStep()

DbU::Unit Hurricane::DbU::getSymbolicSnapGridStep ( )
static

Get the symbolic grid step.

◆ getOnSymbolicSnapGrid()

DbU::Unit Hurricane::DbU::getOnSymbolicSnapGrid ( DbU::Unit  u,
DbU::SnapMode  mode = Nearest 
)
static

Get the snap point from the unit u, using the rounding mode mode.

◆ setSymbolicSnapGridStep()

void Hurricane::DbU::setSymbolicSnapGridStep ( DbU::Unit  step)
inlinestatic

Set the symbolic grid step.

◆ getOnCustomGrid()

DbU::Unit Hurricane::DbU::getOnCustomGrid ( DbU::Unit  u,
DbU::Unit  step,
DbU::SnapMode  mode = Nearest 
)
static

Get the snap point from the unit u, with grid step step using the rounding mode mode.

Referenced by getOnPhysicalGrid().

◆ getOnPhysicalGrid()

DbU::Unit Hurricane::DbU::getOnPhysicalGrid ( DbU::Unit  u,
DbU::SnapMode  mode = Superior 
)
inlinestatic

Get the physical grid unit nearest to u, with mode rounding. using the rounding mode mode.

References getOnCustomGrid(), and grid().

◆ toDb()

long Hurricane::DbU::toDb ( DbU::Unit  u)
inlinestatic

Returns: the external value associated to the unit <unit> according to the current precision. This function do nothing apart from a type cast.

Referenced by getDb().

◆ toGrid()

double Hurricane::DbU::toGrid ( DbU::Unit  u)
inlinestatic

Returns: the value expressed as a number of founder grid steps associated to the unit <unit> according to the current precision.

Referenced by getGrid(), and toLambda().

◆ toLambda()

double Hurricane::DbU::toLambda ( DbU::Unit  u)
inlinestatic

Returns: the symbolic value (expressed as a number lambdas) associated to the unit <unit> according to the current precision.

References toGrid().

Referenced by getLambda().

◆ toPhysical()

double Hurricane::DbU::toPhysical ( DbU::Unit  u,
UnitPower  p 
)
inlinestatic

Returns: the physical value of u, expressed in the power p.

◆ getDb()

long Hurricane::DbU::getDb ( DbU::Unit  u)
inlinestatic

Returns: the external value associated to the unit <unit> according to the current precision. This function do nothing apart from a type cast.

References toDb().

◆ getGrid()

double Hurricane::DbU::getGrid ( DbU::Unit  u)
inlinestatic

Returns: the value expressed as a number of founder grid steps associated to the unit <unit> according to the current precision.

References toGrid().

◆ getLambda()

double Hurricane::DbU::getLambda ( DbU::Unit  u)
inlinestatic

Returns: the symbolic value (expressed as a number lambdas) associated to the unit <unit> according to the current precision.

References toLambda().

◆ getValueString()

string Hurricane::DbU::getValueString ( Unit  unit,
int  mode = SmartTruncate 
)
static
Returns
A character string representing the external value of <unit>. The value is converted in the length according to setStringMode(): database, grid or symbolic.
Remarks
This string is shorter than the one we could print from the external value because non needed decimals are not drawn (nor the point if value is integer).

◆ setStringMode()

void Hurricane::DbU::setStringMode ( unsigned int  mode,
UnitPower  p = Nano 
)
static

Sets in which length the units are to be displayed by getValueString(). Avalaibles modes are :


The documentation for this class was generated from the following files:


Generated by doxygen 1.9.1 on Thu Aug 11 2022 Return to top of page
Hurricane VLSI Database Copyright © 2000-2020 Bull S.A. All rights reserved