<commit_before>#pragma once
#include <map>
#include <vector>

#include "timing_graph_fwd.hpp"

class TimingConstraints {
    public:
        //Getters
        bool should_analyze(DomainId src_domain, DomainId sink_domain) const;
        float setup_clock_constraint(DomainId src_domain, DomainId sink_domain) const;
        float hold_clock_constraint(DomainId src_domain, DomainId sink_domain) const;
        float input_constraint(NodeId node_id) const;
        float output_constraint(NodeId node_id) const;

        //Setters
        void add_setup_clock_constraint(const DomainId src_domain, const DomainId sink_domain, const float constraint);
        void add_hold_clock_constraint(const DomainId src_domain, const DomainId sink_domain, const float constraint);
        void add_input_constraint(const NodeId node_id, const float constraint);
        void add_output_constraint(const NodeId node_id, const float constraint);

        void remap_nodes(const std::vector<NodeId>& node_map);

        void print();
    private:
        //TODO: determine better data structures for this
        //Clock constraints
        std::map<std::pair<DomainId,DomainId>,float> setup_clock_constraints_;
        std::map<std::pair<DomainId,DomainId>,float> hold_clock_constraints_;
        std::map<NodeId,float> input_constraints_;
        std::map<NodeId,float> output_constraints_;
};
<commit_msg>Add docs to TimingConstraint<commit_after>#pragma once
#include <map>
#include <vector>

#include "timing_graph_fwd.hpp"

/**
 * The TimingConstraints class stores all the timing constraints applied during timing analysis.
 */
class TimingConstraints {
    public:
        /*
         * Getters
         */
        ///Indicates whether the paths between src_domain and sink_domain should be analyzed
        ///\param src_domain The ID of the source (launch) clock domain
        ///\param sink_domain The ID of the sink (capture) clock domain
        bool should_analyze(DomainId src_domain, DomainId sink_domain) const;

        ///\returns The setup (max) constraint between src_domain and sink_domain
        float setup_clock_constraint(DomainId src_domain, DomainId sink_domain) const;

        ///\returns The hold (min) constraint between src_domain and sink_domain
        float hold_clock_constraint(DomainId src_domain, DomainId sink_domain) const;

        ///\returns The input delay constraint on node_id
        float input_constraint(NodeId node_id) const;

        ///\returns The output delay constraint on node_id
        float output_constraint(NodeId node_id) const;

        /*
         * Setters
         */
        ///Adds a setup constraint between src_domain and sink_domain with value constraint
        void add_setup_clock_constraint(const DomainId src_domain, const DomainId sink_domain, const float constraint);

        ///Adds a hold constraint between src_domain and sink_domain with value constraint
        void add_hold_clock_constraint(const DomainId src_domain, const DomainId sink_domain, const float constraint);

        ///Adds an input delay constraint on node_id with value constraint
        void add_input_constraint(const NodeId node_id, const float constraint);

        ///Adds an output delay constraint on node_id with value constraint
        void add_output_constraint(const NodeId node_id, const float constraint);

        ///Update node IDs if they have changed
        ///\param node_map A vector mapping from old to new node ids
        void remap_nodes(const std::vector<NodeId>& node_map);

        ///Prints out the timing constraints for debug purposes
        void print();
    private:
        //TODO: determine better data structures for this
        //Clock constraints
        std::map<std::pair<DomainId,DomainId>,float> setup_clock_constraints_;
        std::map<std::pair<DomainId,DomainId>,float> hold_clock_constraints_;
        std::map<NodeId,float> input_constraints_;
        std::map<NodeId,float> output_constraints_;
};

{'fraction_non_alphanumeric': 0.07212622088655146, 'fraction_numerical': 0.0, 'mean_word_length': 3.3841931942919867, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5204133', 'n_tokens_mistral': 1069, 'n_tokens_neox': 1038, 'n_words': 340}