Skip to content

Commit a4226a0

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

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

libs/libarchfpga/src/read_fpga_interchange_arch.cpp

Lines changed: 24 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");
@@ -250,10 +260,16 @@ struct ArchReader {
250260

251261
grid_def.grid_type = GridDefType::FIXED;
252262
std::string name = std::string(ar_.getName());
263+
253264
if (name == "auto") {
265+
// At the moment, the interchange specifies fixed-layout only architectures,
266+
// and allowing for auto-sizing could potentially be implemented later on
267+
// to allow for experimentation on new architectures.
268+
// For the time being the layout is restricted to be only fixed.
254269
archfpga_throw(arch_file_, __LINE__,
255270
"The name auto is reserved for auto-size layouts; please choose another name");
256271
}
272+
257273
grid_def.name = name;
258274
for (auto tile : tileList) {
259275
t_metadata_dict data;
@@ -287,6 +303,9 @@ struct ArchReader {
287303
*
288304
* As the interchange format develops further, with possibly more details, this function can
289305
* become dynamic, allowing for different parameters for the different architectures.
306+
*
307+
* FIXME: This will require to be dynamically assigned, and a suitable representation added
308+
* to the FPGA interchange device schema.
290309
*/
291310
arch_->R_minW_nmos = 6065.520020;
292311
arch_->R_minW_pmos = 18138.500000;
@@ -362,6 +381,7 @@ struct ArchReader {
362381
std::string mux_type_string = entry.first ? "mux_" : "passGate_";
363382
name << mux_type_string;
364383

384+
// FIXME: allow to dynamically choose different speed models and corners
365385
R = get_corner_value(model.getOutputResistance(), "slow", "min");
366386
name << "R" << std::scientific << R;
367387

@@ -437,6 +457,10 @@ struct ArchReader {
437457
arch_->Segments[index].Rmetal = 0;
438458
arch_->Segments[index].Cmetal = 0;
439459
arch_->Segments[index].parallel_axis = BOTH_AXIS;
460+
461+
// TODO: Only bi-directional segments are created, but it the interchange format
462+
// has directionality information on PIPs, which may be used to infer the
463+
// segments' directonality.
440464
arch_->Segments[index].directionality = BI_DIRECTIONAL;
441465
arch_->Segments[index].arch_wire_switch = 1;
442466
arch_->Segments[index].arch_opin_switch = 1;

0 commit comments

Comments
 (0)