From 4533d160c563be793602e02ee98d11d440a52915 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Sun, 24 Nov 2024 22:20:59 -0800 Subject: [PATCH] [core] developming default mode overwrite through bitstream setting file --- libs/libarchopenfpga/src/bitstream_setting.h | 39 +++++++++++++++++++ .../src/bitstream_setting_fwd.h | 2 + 2 files changed, 41 insertions(+) diff --git a/libs/libarchopenfpga/src/bitstream_setting.h b/libs/libarchopenfpga/src/bitstream_setting.h index 042e850e0..3239661eb 100644 --- a/libs/libarchopenfpga/src/bitstream_setting.h +++ b/libs/libarchopenfpga/src/bitstream_setting.h @@ -10,6 +10,7 @@ #include "bitstream_setting_fwd.h" #include "vtr_vector.h" +#include "vtr_geometry.h" /* namespace openfpga begins */ namespace openfpga { @@ -58,6 +59,9 @@ class BitstreamSetting { typedef vtr::vector::const_iterator bitstream_pb_type_setting_iterator; + typedef vtr::vector::const_iterator + bitstream_default_mode_setting_iterator; typedef vtr::vector::const_iterator bitstream_interconnect_setting_iterator; @@ -67,6 +71,8 @@ class BitstreamSetting { /* Create range */ typedef vtr::Range bitstream_pb_type_setting_range; + typedef vtr::Range + bitstream_default_mode_setting_range; typedef vtr::Range bitstream_interconnect_setting_range; typedef vtr::Range overwrite_bitstream_range; @@ -76,6 +82,7 @@ class BitstreamSetting { public: /* Accessors: aggregates */ bitstream_pb_type_setting_range pb_type_settings() const; + bitstream_default_mode_setting_range default_mode_settings() const; bitstream_interconnect_setting_range interconnect_settings() const; overwrite_bitstream_range overwrite_bitstreams() const; @@ -94,6 +101,19 @@ class BitstreamSetting { const BitstreamPbTypeSettingId& pb_type_setting_id) const; size_t bitstream_offset( const BitstreamPbTypeSettingId& pb_type_setting_id) const; + + /* Default Mode Bit settings */ + std::string default_mode_pb_type_name( + const BitstreamDefaultModeSettingId& default_mode_setting_id) const; + std::vector default_mode_parent_pb_type_names( + const BitstreamDefaultModeSettingId& default_mode_setting_id) const; + std::vector default_mode_parent_mode_names( + const BitstreamDefaultModeSettingId& default_mode_setting_id) const; + vtr::Rect default_mode_coord( + const BitstreamDefaultModeSettingId& default_mode_setting_id) const; + vtr::Point default_mode_subtile( + const BitstreamDefaultModeSettingId& default_mode_setting_id) const; + std::string interconnect_name( const BitstreamInterconnectSettingId& interconnect_setting_id) const; std::vector parent_pb_type_names( @@ -118,6 +138,13 @@ class BitstreamSetting { void set_bitstream_offset(const BitstreamPbTypeSettingId& pb_type_setting_id, const size_t& offset); + BitstreamDefaultModeSettingId add_bitstream_default_mode_setting( + const std::string& pb_type_name, + const std::vector& parent_pb_type_names, + const std::vector& parent_mode_names, + const std::string& mode_bits, const vtr::Rect& coord, const vtr::Point& subtile_range); + + BitstreamInterconnectSettingId add_bitstream_interconnect_setting( const std::string& interconnect_name, const std::vector& parent_pb_type_names, @@ -158,6 +185,18 @@ class BitstreamSetting { * pb_type */ vtr::vector bitstream_offsets_; + /* Pb type - default mode bits overwrite */ + vtr::vector + default_mode_setting_ids_; + vtr::vector default_mode_pb_type_names_; + vtr::vector> + default_mode_parent_pb_type_names_; + vtr::vector> + default_mode_parent_mode_names_; + vtr::vector pb_type_default_mode_bits_; + vtr::vector> pb_type_coords_; + vtr::vector> pb_type_subtile_ranges_; + /* Interconnect-related settings: * - Name of interconnect under a given pb_type * - The default path to be considered for a given interconnect during diff --git a/libs/libarchopenfpga/src/bitstream_setting_fwd.h b/libs/libarchopenfpga/src/bitstream_setting_fwd.h index dbcc70553..227de3e6e 100644 --- a/libs/libarchopenfpga/src/bitstream_setting_fwd.h +++ b/libs/libarchopenfpga/src/bitstream_setting_fwd.h @@ -19,6 +19,8 @@ struct overwrite_bitstream_id_tag; typedef vtr::StrongId BitstreamPbTypeSettingId; +typedef vtr::StrongId + BitstreamDefaultModeSettingId; typedef vtr::StrongId BitstreamInterconnectSettingId; typedef vtr::StrongId OverwriteBitstreamId;