Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
amin1377 committed Dec 13, 2024
2 parents 18622c6 + ce706d5 commit e99cfd4
Show file tree
Hide file tree
Showing 358 changed files with 12,670 additions and 5,558 deletions.
Binary file modified doc/src/quickstart/blink_implementation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
318 changes: 188 additions & 130 deletions doc/src/quickstart/index.rst

Large diffs are not rendered by default.

Binary file modified doc/src/quickstart/tseng_blk1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/src/quickstart/tseng_nets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions libs/EXTERNAL/libblifparse/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ add_library(libblifparse STATIC
target_include_directories(libblifparse PUBLIC ${LIB_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR})
set_target_properties(libblifparse PROPERTIES PREFIX "") #Avoid extra 'lib' prefix

# Set the read buffer size in the generated lexers. This reduces the number of
# syscalls since the default is only 1kB.
target_compile_definitions(libblifparse PRIVATE YY_READ_BUF_SIZE=1048576)

#Create the test executable
add_executable(blifparse_test src/main.cpp)
target_link_libraries(blifparse_test libblifparse)
Expand Down
2 changes: 1 addition & 1 deletion libs/EXTERNAL/libcatch2
Submodule libcatch2 updated 31 files
+2 −1 .clang-tidy
+1 −1 .github/workflows/mac-builds-m1.yml
+6 −2 .github/workflows/mac-builds.yml
+2 −0 BUILD.bazel
+1 −0 CMake/CatchConfigOptions.cmake
+6 −1 CMakeLists.txt
+9 −0 docs/configuration.md
+4 −4 src/catch2/benchmark/detail/catch_stats.cpp
+1 −1 src/catch2/catch_timer.cpp
+4 −1 src/catch2/catch_tostring.cpp
+9 −0 src/catch2/catch_user_config.hpp.in
+39 −31 src/catch2/internal/catch_compiler_capabilities.hpp
+1 −1 src/catch2/internal/catch_console_colour.cpp
+1 −1 src/catch2/internal/catch_random_number_generator.cpp
+35 −26 src/catch2/matchers/catch_matchers_range_equals.hpp
+5 −2 src/catch2/reporters/catch_reporter_console.cpp
+0 −1 tests/ExtraTests/CMakeLists.txt
+5 −1 tests/SelfTest/Baselines/compact.sw.approved.txt
+5 −1 tests/SelfTest/Baselines/compact.sw.multi.approved.txt
+1 −1 tests/SelfTest/Baselines/console.std.approved.txt
+35 −1 tests/SelfTest/Baselines/console.sw.approved.txt
+35 −1 tests/SelfTest/Baselines/console.sw.multi.approved.txt
+3 −1 tests/SelfTest/Baselines/junit.sw.approved.txt
+3 −1 tests/SelfTest/Baselines/junit.sw.multi.approved.txt
+2 −0 tests/SelfTest/Baselines/sonarqube.sw.approved.txt
+2 −0 tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt
+9 −1 tests/SelfTest/Baselines/tap.sw.approved.txt
+9 −1 tests/SelfTest/Baselines/tap.sw.multi.approved.txt
+39 −1 tests/SelfTest/Baselines/xml.sw.approved.txt
+39 −1 tests/SelfTest/Baselines/xml.sw.multi.approved.txt
+19 −0 tests/SelfTest/UsageTests/MatchersRanges.tests.cpp
2 changes: 1 addition & 1 deletion libs/EXTERNAL/libezgl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)

# create the project
project(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)

project(
basic-application
Expand Down
2 changes: 1 addition & 1 deletion libs/EXTERNAL/libtatum/libtatum/tatum/SetupAnalysis.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace tatum {

/** \file
* The 'SetupAnalysis' class defines the operations needed by a GraphWalker class
* to perform a setup (max/longest path) analysis. It satisifes and extends the GraphVisitor
* to perform a setup (max/longest path) analysis. It satisfies and extends the GraphVisitor
* concept class.
*
* Setup Analysis Principles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Time TimingConstraints::setup_constraint(const DomainId src_domain, const Domain
return iter->second;
}

//If no capture node specific constraint was found, fallback to the domain pair constriant
//If no capture node specific constraint was found, fallback to the domain pair constraint
iter = setup_constraints_.find(NodeDomainPair(src_domain, sink_domain, NodeId::INVALID()));
if(iter != setup_constraints_.end()) {
return iter->second;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class TimingConstraints {
///\returns The source NodeId of the specified domain
NodeId clock_domain_source_node(const DomainId id) const;

//\returns whether the specified domain id corresponds to a virtual lcock
//\returns whether the specified domain id corresponds to a virtual clock
bool is_virtual_clock(const DomainId id) const;

///\returns The domain of the specified node id if it is a clock source
Expand Down
23 changes: 11 additions & 12 deletions libs/EXTERNAL/libtatum/libtatum/tatum/TimingGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ NodeId TimingGraph::add_node(const NodeType type) {

EdgeId TimingGraph::add_edge(const EdgeType type, const NodeId src_node, const NodeId sink_node) {
//We require that the source/sink node must already be in the graph,
// so we can update them with thier edge references
// so we can update them with their edge references
TATUM_ASSERT(valid_node_id(src_node));
TATUM_ASSERT(valid_node_id(sink_node));

Expand All @@ -211,7 +211,7 @@ EdgeId TimingGraph::add_edge(const EdgeType type, const NodeId src_node, const N
EdgeId edge_id = EdgeId(edge_ids_.size());
edge_ids_.push_back(edge_id);

//Create the edgge
//Create the edge
edge_types_.push_back(type);
edge_src_nodes_.push_back(src_node);
edge_sink_nodes_.push_back(sink_node);
Expand Down Expand Up @@ -318,7 +318,7 @@ GraphIdMaps TimingGraph::compress() {
levelize();
validate();

return {node_id_map, edge_id_map};
return {std::move(node_id_map), std::move(edge_id_map)};
}

void TimingGraph::levelize() {
Expand Down Expand Up @@ -474,21 +474,20 @@ GraphIdMaps TimingGraph::optimize_layout() {

levelize();

return {node_id_map, edge_id_map};
return {std::move(node_id_map), std::move(edge_id_map)};
}

tatum::util::linear_map<EdgeId,EdgeId> TimingGraph::optimize_edge_layout() const {
//Make all edges in a level be contiguous in memory

//Determine the edges driven by each level of the graph
std::vector<std::vector<EdgeId>> edge_levels;
std::vector<std::vector<EdgeId>> edge_levels(levels().size());
for(LevelId level_id : levels()) {
edge_levels.push_back(std::vector<EdgeId>());
for(auto node_id : level_nodes(level_id)) {
for(NodeId node_id : level_nodes(level_id)) {

//We walk the nodes according to the input-edge order.
//This is the same order used by the arrival-time traversal (which is responsible
//for most of the analyzer run-time), so matching it's order exactly results in
//for most of the analyzer run-time), so matching its order exactly results in
//better cache locality
for(EdgeId edge_id : node_in_edges(node_id)) {

Expand All @@ -498,7 +497,7 @@ tatum::util::linear_map<EdgeId,EdgeId> TimingGraph::optimize_edge_layout() const
}
}

//Maps from from original to new edge id, used to update node to edge refs
//Maps from original to new edge id, used to update node to edge refs
tatum::util::linear_map<EdgeId,EdgeId> orig_to_new_edge_id(edges().size());

//Determine the new order
Expand Down Expand Up @@ -874,7 +873,7 @@ std::vector<std::vector<NodeId>> identify_combinational_loops(const TimingGraph&
}

std::vector<NodeId> find_transitively_connected_nodes(const TimingGraph& tg,
const std::vector<NodeId> through_nodes,
const std::vector<NodeId>& through_nodes,
size_t max_depth) {
std::vector<NodeId> nodes;

Expand All @@ -890,7 +889,7 @@ std::vector<NodeId> find_transitively_connected_nodes(const TimingGraph& tg,
}

std::vector<NodeId> find_transitive_fanin_nodes(const TimingGraph& tg,
const std::vector<NodeId> sinks,
const std::vector<NodeId>& sinks,
size_t max_depth) {
std::vector<NodeId> nodes;

Expand All @@ -905,7 +904,7 @@ std::vector<NodeId> find_transitive_fanin_nodes(const TimingGraph& tg,
}

std::vector<NodeId> find_transitive_fanout_nodes(const TimingGraph& tg,
const std::vector<NodeId> sources,
const std::vector<NodeId>& sources,
size_t max_depth) {
std::vector<NodeId> nodes;

Expand Down
36 changes: 21 additions & 15 deletions libs/EXTERNAL/libtatum/libtatum/tatum/TimingGraph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
* store all edges as bi-directional edges.
*
* NOTE: We store only the static connectivity and node information in the 'TimingGraph' class.
* Other dynamic information (edge delays, node arrival/required times) is stored seperately.
* This means that most actions opearting on the timing graph (e.g. TimingAnalyzers) only
* Other dynamic information (edge delays, node arrival/required times) is stored separately.
* This means that most actions operating on the timing graph (e.g. TimingAnalyzers) only
* require read-only access to the timing graph.
*
* Accessing Graph Data
Expand All @@ -28,9 +28,9 @@
* rather than the more typical "Array of Structs (AoS)" data layout.
*
* By using a SoA layout we keep all data for a particular field (e.g. node types) in contiguous
* memory. Using an AoS layout the various fields accross nodes would *not* be contiguous
* memory. Using an AoS layout the various fields across nodes would *not* be contiguous
* (although the different fields within each object (e.g. a TimingNode class) would be contiguous.
* Since we typically perform operations on particular fields accross nodes the SoA layout performs
* Since we typically perform operations on particular fields across nodes the SoA layout performs
* better (and enables memory ordering optimizations). The edges are also stored in a SOA format.
*
* The SoA layout also motivates the ID based approach, which allows direct indexing into the required
Expand All @@ -48,11 +48,12 @@
* and ensures that each cache line pulled into the cache will (likely) be accessed multiple times
* before being evicted.
*
* Note that performing these optimizations is currently done explicity by calling the optimize_edge_layout()
* and optimize_node_layout() member functions. In the future (particularily if incremental modification
* Note that performing these optimizations is currently done explicitly by calling the optimize_edge_layout()
* and optimize_node_layout() member functions. In the future (particularly if incremental modification
* support is added), it may be a good idea apply these modifications automatically as needed.
*
*/
#include <utility>
#include <vector>
#include <set>
#include <limits>
Expand Down Expand Up @@ -149,7 +150,7 @@ class TimingGraph {

///\pre The graph must be levelized.
///\returns A range containing the nodes which are primary inputs (i.e. SOURCE's with no fanin, corresponding to top level design inputs pins)
///\warning Not all SOURCE nodes in the graph are primary inputs (e.g. FF Q pins are SOURCE's but have incomming edges from the clock network)
///\warning Not all SOURCE nodes in the graph are primary inputs (e.g. FF Q pins are SOURCE's but have incoming edges from the clock network)
///\see levelize()
node_range primary_inputs() const {
TATUM_ASSERT_MSG(is_levelized_, "Timing graph must be levelized");
Expand Down Expand Up @@ -282,7 +283,7 @@ class TimingGraph {
//Node data
tatum::util::linear_map<NodeId,NodeId> node_ids_; //The node IDs in the graph
tatum::util::linear_map<NodeId,NodeType> node_types_; //Type of node
tatum::util::linear_map<NodeId,std::vector<EdgeId>> node_in_edges_; //Incomiing edge IDs for node
tatum::util::linear_map<NodeId,std::vector<EdgeId>> node_in_edges_; //Incoming edge IDs for node
tatum::util::linear_map<NodeId,std::vector<EdgeId>> node_out_edges_; //Out going edge IDs for node
tatum::util::linear_map<NodeId,LevelId> node_levels_; //Out going edge IDs for node

Expand All @@ -293,12 +294,12 @@ class TimingGraph {
tatum::util::linear_map<EdgeId,NodeId> edge_src_nodes_; //Source node for each edge
tatum::util::linear_map<EdgeId,bool> edges_disabled_;

//Auxilary graph-level info, filled in by levelize()
//Auxiliary graph-level info, filled in by levelize()
tatum::util::linear_map<LevelId,LevelId> level_ids_; //The level IDs in the graph
tatum::util::linear_map<LevelId,std::vector<NodeId>> level_nodes_; //Nodes in each level
std::vector<NodeId> primary_inputs_; //Primary input nodes of the timing graph.
std::vector<NodeId> logical_outputs_; //Logical output nodes of the timing graph.
bool is_levelized_ = false; //Inidcates if the current levelization is valid
bool is_levelized_ = false; //Indicates if the current levelization is valid

bool allow_dangling_combinational_nodes_ = false;

Expand All @@ -310,26 +311,31 @@ std::vector<std::vector<NodeId>> identify_combinational_loops(const TimingGraph&
//Returns the set of nodes transitively connected (either fanin or fanout) to nodes in through_nodes
//up to max_depth (default infinite) hops away
std::vector<NodeId> find_transitively_connected_nodes(const TimingGraph& tg,
const std::vector<NodeId> through_nodes,
const std::vector<NodeId>& through_nodes,
size_t max_depth=std::numeric_limits<size_t>::max());

//Returns the set of nodes in the transitive fanin of nodes in sinks up to max_depth (default infinite) hops away
std::vector<NodeId> find_transitive_fanin_nodes(const TimingGraph& tg,
const std::vector<NodeId> sinks,
const std::vector<NodeId>& sinks,
size_t max_depth=std::numeric_limits<size_t>::max());

//Returns the set of nodes in the transitive fanout of nodes in sources up to max_depth (default infinite) hops away
std::vector<NodeId> find_transitive_fanout_nodes(const TimingGraph& tg,
const std::vector<NodeId> sources,
const std::vector<NodeId>& sources,
size_t max_depth=std::numeric_limits<size_t>::max());

EdgeType infer_edge_type(const TimingGraph& tg, EdgeId edge);

//Mappings from old to new IDs
struct GraphIdMaps {
GraphIdMaps(tatum::util::linear_map<NodeId,NodeId> node_map,
tatum::util::linear_map<EdgeId,EdgeId> edge_map)
GraphIdMaps(const tatum::util::linear_map<NodeId,NodeId>& node_map,
const tatum::util::linear_map<EdgeId,EdgeId>& edge_map)
: node_id_map(node_map), edge_id_map(edge_map) {}

GraphIdMaps(tatum::util::linear_map<NodeId,NodeId>&& node_map,
tatum::util::linear_map<EdgeId,EdgeId>&& edge_map)
: node_id_map(std::move(node_map)), edge_id_map(std::move(edge_map)) {}

tatum::util::linear_map<NodeId,NodeId> node_id_map;
tatum::util::linear_map<EdgeId,EdgeId> edge_id_map;
};
Expand Down
6 changes: 3 additions & 3 deletions libs/EXTERNAL/libtatum/libtatum/tatum/analyzer_factory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace tatum {
* This file defines the AnalyzerFactory class used to construct timing analyzers.
*
* We assume that the user has already defined the timing graph, constraints and
* thier own delay calculator:
* their own delay calculator:
*
* TimingGraph timing_graph;
* TimingConstraints timing_constraints;
Expand All @@ -33,7 +33,7 @@ namespace tatum {
* timing_constraints,
* delay_calculator);
*
* We can similarily generate analyzers for other types of analysis, for instance Hold:
* We can similarly generate analyzers for other types of analysis, for instance Hold:
*
* auto hold_analyzer = AnalyzerFactory<SetupAnalysis>::make(timing_graph,
* timing_constraints,
Expand All @@ -45,7 +45,7 @@ namespace tatum {
* timing_constraints,
* delay_calculator);
*
* The AnalzyerFactory returns a std::unique_ptr to the appropriate TimingAnalyzer sub-class:
* The AnalyzerFactory returns a std::unique_ptr to the appropriate TimingAnalyzer sub-class:
*
* SetupAnalysis => SetupTimingAnalyzer
* HoldAnalysis => HoldTimingAnalyzer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace tatum {

/**
* An exmaple DelayCalculator implementation which takes
* An example DelayCalculator implementation which takes
* a vector of fixed pre-calculated edge delays
*
* \see DelayCalculator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace tatum { namespace detail {
*
* The operations for CommonAnalysisVisitor to perform setup analysis.
* The setup analysis operations define that maximum edge delays are used, and that the
* maixmum arrival time (and minimum required times) are propagated through the timing graph.
* maximum arrival time (and minimum required times) are propagated through the timing graph.
*
* \see HoldAnalysisOps
* \see SetupAnalysisOps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ bool CommonAnalysisVisitor<AnalysisOps>::do_arrival_pre_traverse_node(const Timi
bool node_constrained = false;

if(tc.node_is_constant_generator(node_id)) {
//We progpagate the tags from constant generators to ensure any sinks driven
//We propagate the tags from constant generators to ensure any sinks driven
//only by constant generators are recorded as constrained.
//
//We use a special tag to initialize constant generators which gets overritten
//We use a special tag to initialize constant generators which gets overwritten
//by any non-constant tag at downstream nodes

TimingTag const_gen_tag = ops_.const_gen_tag();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class GraphVisitor {
virtual void do_reset_node_arrival_tags_from_origin(const NodeId node_id, const NodeId origin) = 0;
virtual void do_reset_node_required_tags_from_origin(const NodeId node_id, const NodeId origin) = 0;

//Returns true if the specified source/sink is unconstrainted
//Returns true if the specified source/sink is unconstrained
virtual bool do_arrival_pre_traverse_node(const TimingGraph& tg, const TimingConstraints& tc, const NodeId node_id) = 0;
virtual bool do_required_pre_traverse_node(const TimingGraph& tg, const TimingConstraints& tc, const NodeId node_id) = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace tatum { namespace detail {
*
* The operations for CommonAnalysisVisitor to perform setup analysis.
* The setup analysis operations define that maximum edge delays are used, and that the
* maixmum arrival time (and minimum required times) are propagated through the timing graph.
* maximum arrival time (and minimum required times) are propagated through the timing graph.
*
* \see HoldAnalysisOps
* \see CommonAnalysisVisitor
Expand Down Expand Up @@ -121,7 +121,7 @@ class SetupAnalysisOps : public CommonAnalysisOps {
Time calculate_slack(const Time required_time, const Time arrival_time) {
//Setup requires the arrival to occur *before* the required time, so
//slack is the amount of required time left after the arrival time; meaning
//we we subtract the arrival time from the required time to get the setup slack
//we subtract the arrival time from the required time to get the setup slack
return required_time - arrival_time;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace tatum {

/**
* A parallel timing analyzer which traveres the timing graph in a levelized
* A parallel timing analyzer which traverses the timing graph in a levelized
* manner. However nodes within each level are processed in parallel using
* Thread Building Blocks (TBB). If TBB is not available it operates serially and is
* equivalent to the SerialWalker.
Expand Down
4 changes: 4 additions & 0 deletions libs/libarchfpga/src/device_grid.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ class DeviceGrid {
size_t width() const { return grid_.dim_size(1); }
///@brief Return the height of the grid at the specified layer
size_t height() const { return grid_.dim_size(2); }
///@brief Return the grid dimensions in (# of layers, width, height) format
std::tuple<size_t, size_t, size_t> dim_sizes() const {
return {grid_.dim_size(0), grid_.dim_size(1), grid_.dim_size(2)};
}

///@brief Return the size of the flattened grid on the given layer
inline size_t grid_size() const {
Expand Down
10 changes: 8 additions & 2 deletions libs/libpugiutil/src/pugixml_loc.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
#include <cstdio>
#include <algorithm>
#include <vector>
#include "pugixml_util.hpp"
#include "pugixml_loc.hpp"

// The size of the read buffer when reading from a file.
#ifndef PUGI_UTIL_READ_BUF_SIZE
#define PUGI_UTIL_READ_BUF_SIZE 1048576
#endif // PUGI_UTIL_READ_BUF_SIZE

namespace pugiutil {

//Return the line number from the given offset
Expand Down Expand Up @@ -30,10 +36,10 @@ void loc_data::build_loc_data() {

std::ptrdiff_t offset = 0;

char buffer[1024];
std::vector<char> buffer(PUGI_UTIL_READ_BUF_SIZE);
std::size_t size;

while ((size = fread(buffer, 1, sizeof(buffer), f)) > 0) {
while ((size = fread(buffer.data(), 1, buffer.size() * sizeof(char), f)) > 0) {
for (std::size_t i = 0; i < size; ++i) {
if (buffer[i] == '\n') {
offsets_.push_back(offset + i);
Expand Down
2 changes: 1 addition & 1 deletion libs/librrgraph/src/base/rr_spatial_lookup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ std::vector<RRNodeId> RRSpatialLookup::find_nodes(int layer,
nodes.reserve(num_nodes);
for (const auto& node : rr_node_indices_[type][layer][node_x][node_y][side]) {
if (RRNodeId(node)) {
nodes.push_back(RRNodeId(node));
nodes.emplace_back(node);
}
}

Expand Down
Loading

0 comments on commit e99cfd4

Please sign in to comment.