Skip to content

Commit e60e82f

Browse files
committed
libs: arch: interchange: added comments
Signed-off-by: Alessandro Comodi <[email protected]>
1 parent f79c714 commit e60e82f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

libs/libarchfpga/src/read_fpga_interchange_arch.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ using namespace DeviceResources;
3434
using namespace LogicalNetlist;
3535
using namespace capnp;
3636

37+
/**
38+
* @brief The FPGA interchange timing model includes three different corners (min, typ and max) for each of the two
39+
* speed_models (slow and fast).
40+
*
41+
* Timing data can be found on PIPs, nodes, site pins and bel pins.
42+
* This function retrieves the timing value based on the wanted speed model and the wanted corner.
43+
*
44+
* More information on the FPGA Interchange timing model can be found here:
45+
* - https://github.com/chipsalliance/fpga-interchange-schema/blob/main/interchange/DeviceResources.capnp
46+
*/
3747
static float get_corner_value(Device::CornerModel::Reader model, const char* speed_model, const char* value) {
3848
bool slow_model = std::string(speed_model) == std::string("slow");
3949
bool fast_model = std::string(speed_model) == std::string("fast");
@@ -287,6 +297,9 @@ struct ArchReader {
287297
*
288298
* As the interchange format develops further, with possibly more details, this function can
289299
* become dynamic, allowing for different parameters for the different architectures.
300+
*
301+
* FIXME: This will require to be dynamically assigned, and a suitable representation added
302+
* to the FPGA interchange device schema.
290303
*/
291304
arch_->R_minW_nmos = 6065.520020;
292305
arch_->R_minW_pmos = 18138.500000;
@@ -362,6 +375,7 @@ struct ArchReader {
362375
std::string mux_type_string = entry.first ? "mux_" : "passGate_";
363376
name << mux_type_string;
364377

378+
// FIXME: allow to dynamically choose different speed models and corners
365379
R = get_corner_value(model.getOutputResistance(), "slow", "min");
366380
name << "R" << std::scientific << R;
367381

@@ -437,6 +451,10 @@ struct ArchReader {
437451
arch_->Segments[index].Rmetal = 0;
438452
arch_->Segments[index].Cmetal = 0;
439453
arch_->Segments[index].parallel_axis = BOTH_AXIS;
454+
455+
// TODO: Only bi-directional segments are created, but it the interchange format
456+
// has directionality information on PIPs, which may be used to infer the
457+
// segments' directonality.
440458
arch_->Segments[index].directionality = BI_DIRECTIONAL;
441459
arch_->Segments[index].arch_wire_switch = 1;
442460
arch_->Segments[index].arch_opin_switch = 1;

0 commit comments

Comments
 (0)