Fixed point numbers management. More...
Classes | |
class | Hurricane::DbU |
DataBase Unit managment (API). More... | |
Typedefs | |
typedef std::int64_t | Hurricane::DbU::Unit |
Enumerations | |
enum | Hurricane::DbU::StringMode { Hurricane::DbU::Db = (1<<0), Hurricane::DbU::Grid = (1<<1), Hurricane::DbU::Symbolic = (1<<2) } |
enum | Hurricane::DbU::UnitPower { Hurricane::DbU::Pico = 1, Hurricane::DbU::Nano, Hurricane::DbU::Micro, Hurricane::DbU::Milli, Hurricane::DbU::Unity, Hurricane::DbU::Kilo } |
enum | Hurricane::DbU::SnapMode { Hurricane::DbU::Inferior = 1, Hurricane::DbU::Superior = 2, Hurricane::DbU::Nearest = 4 } |
Obsoleteds | |
Due to their somewhat unclear naming convention, those functions have been renamed by the to / from variants. | |
static Unit | Hurricane::DbU::db (Unit value) |
static Unit | Hurricane::DbU::grid (double value) |
static Unit | Hurricane::DbU::lambda (double value) |
static Unit | Hurricane::DbU::getDb (Unit u) |
static double | Hurricane::DbU::getGrid (Unit u) |
static double | Hurricane::DbU::getLambda (Unit u) |
Fixed point numbers management.
The DbU class provides the DbU::Unit type for modelling geometric length, that is abscissas, ordinates, widths, offsets and a set of functions to convert DbU::Unit to and from external coordinates.
The DbU class manage three king of length :
It is possible to choose (once for all) the precision with which unit values are stored.
This precision represents the maximal number of decimal digits allowed (it applies globally to all units). Therefore for a precision of 3, the unit will represent a value of 0.001 and the founder grid value 23.54 will be represented by a unit equal to 23540.
Related functions :
The resolution is associated to the precision. Indeed it represents the external value associated to the smallest unit, that is the value returned by getGrid(Unit::db(1)).
Related functions : DbU::getResolution()
Set the ratio between grids and lambdas. This must be an even integer. Once sets, musn't be changed.
Related functions :
Thoses function are closely related to editors. They allow to restrict to positions on a grid. We support three kind of grid, real, symbolic and user defined.
Translate a DbU::Unit into grid or lambda length :
Translate a lambda length into a DbU::Unit :
long Hurricane::DbU::Unit |
The working DataBase type for storing dimensions.
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). |
Returns: the unit corresponding to the value <value>
according to the current precision. This function do nothing apart from a cast.
Referenced by Hurricane::DbU::db().
|
inlinestatic |
Returns: the unit corresponding to the grid value <value>
according to the current precision.
Referenced by Hurricane::DbU::fromLambda(), Hurricane::DbU::fromPhysical(), and Hurricane::DbU::grid().
|
inlinestatic |
Returns: the unit corresponding to the symbolic value <value>
according to the current precision.
References Hurricane::DbU::fromGrid().
Referenced by Hurricane::DbU::lambda().
Returns: the unit corresponding to the physical value <value>
with power p
, according to the current precision.
References Hurricane::DbU::fromGrid().
|
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 Hurricane::DbU::getDb().
|
inlinestatic |
Returns: the value expressed as a number of founder grid steps associated to the unit <unit>
according to the current precision.
Referenced by Hurricane::DbU::getGrid(), and Hurricane::DbU::toLambda().
|
inlinestatic |
Returns: the symbolic value (expressed as a number lambdas) associated to the unit <unit>
according to the current precision.
References Hurricane::DbU::toGrid().
Referenced by Hurricane::DbU::getLambda().
Returns: the physical value of u
, expressed in the power p
.
|
static |
Returns: the current precision (whose default is fixed to 1).
|
static |
Returns: the maximal precision allowed (currently fixed to 3).
|
static |
Returns: the current resolution.
|
static |
Returns: Sets how many founder grid steps makes one lambda. It must be an event integer otherwise an exception is thrown.
|
static |
Returns: How many founder grid steps makes one lambda.
Sets in which length the units are to be displayed by getValueString(). Avalaibles modes are :
|
static |
<unit>
. The value is converted in the length according to setStringMode(): database, grid or symbolic.
|
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).
|
inlinestatic |
Set the real (founder) grid step.
|
static |
Get the real (founder) grid step.
|
static |
Get the snap point from the unit u
, using the rounding mode mode
.
|
inlinestatic |
Set the symbolic grid step.
|
static |
Get the symbolic grid step.
|
static |
Get the snap point from the unit u
, using the rounding mode mode
.
|
static |
Get the snap point from the unit u
, with grid step step
using the rounding mode mode
.
Referenced by Hurricane::DbU::getOnPhysicalGrid().
|
inlinestatic |
Get the physical grid unit nearest to u
, with mode
rounding. using the rounding mode mode
.
References Hurricane::DbU::getOnCustomGrid(), and Hurricane::DbU::grid().
Returns: the unit corresponding to the value <value>
according to the current precision. This function do nothing apart from a cast.
References Hurricane::DbU::fromDb().
|
inlinestatic |
Returns: the unit corresponding to the grid value <value>
according to the current precision.
References Hurricane::DbU::fromGrid().
Referenced by Hurricane::DbU::getOnPhysicalGrid().
|
inlinestatic |
Returns: the unit corresponding to the symbolic value <value>
according to the current precision.
References Hurricane::DbU::fromLambda().
|
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 Hurricane::DbU::toDb().
|
inlinestatic |
Returns: the value expressed as a number of founder grid steps associated to the unit <unit>
according to the current precision.
References Hurricane::DbU::toGrid().
|
inlinestatic |
Returns: the symbolic value (expressed as a number lambdas) associated to the unit <unit>
according to the current precision.
References Hurricane::DbU::toLambda().
Generated by doxygen 1.8.14 on Thu Nov 12 2020 | Return to top of page |
Hurricane VLSI Database | Copyright © 2000-2020 Bull S.A. All rights reserved |