diff --git a/src/kiter/kiter.cpp b/src/kiter/kiter.cpp index bbb9a6c..8b5d68d 100644 --- a/src/kiter/kiter.cpp +++ b/src/kiter/kiter.cpp @@ -163,7 +163,7 @@ int main (int argc, char **argv) if (const auto *transformation = KiterRegistry::get(name)) { VERBOSE_INFO ("Run transformation " << transformation->name); transformation->fun(csdf,params); - } else if (const auto *buffer_sizing = KiterRegistry::get(name);) { + } else if (const auto *buffer_sizing = KiterRegistry::get(name)) { VERBOSE_INFO ("Run buffer sizing " << buffer_sizing->name); models::BufferSizingResult res = buffer_sizing->fun(csdf,params); VERBOSE_INFO ("Total size is " << res.total_size()); diff --git a/src/libkiter/algorithms/analysis/cycle_detection.h b/src/libkiter/algorithms/analysis/cycle_detection.h index a180292..e7038fa 100644 --- a/src/libkiter/algorithms/analysis/cycle_detection.h +++ b/src/libkiter/algorithms/analysis/cycle_detection.h @@ -47,10 +47,8 @@ void cycle_detection (models::Dataflow* const dataflow, parameters_list_t } -ADD_ANALYSIS(CycleDetection, - analysis_action_t({ "CycleDetection" , "Returns 1 if there is a cycle in the graph and 0 if not..", algorithms::cycle_detection})); -ADD_ANALYSIS(CycleCount, - analysis_action_t({ "CycleCount" , "Count number of simple cycles in graph.", algorithms::find_simple_cycles})); +ADD_ANALYSIS(CycleDetection, "Returns 1 if there is a cycle in the graph and 0 if not..", algorithms::cycle_detection); +ADD_ANALYSIS(CycleCount,"Count number of simple cycles in graph.", algorithms::find_simple_cycles); diff --git a/src/libkiter/algorithms/buffersizing/backpressure.h b/src/libkiter/algorithms/buffersizing/backpressure.h index 427aaf8..39e52b3 100644 --- a/src/libkiter/algorithms/buffersizing/backpressure.h +++ b/src/libkiter/algorithms/buffersizing/backpressure.h @@ -18,8 +18,7 @@ class Dataflow; namespace algorithms { models::BufferSizingResult compute_backpressure_memory_sizing (models::Dataflow* const dataflow, parameters_list_t); } -ADD_BUFFER_SIZING(BackPressureSizing, - buffer_sizing_action_t({ "BackPressureSizing" , "Buffer sizing method from Wiggers et al DAC 2007 paper.", algorithms::compute_backpressure_memory_sizing})); +ADD_BUFFER_SIZING(BackPressureSizing, "Buffer sizing method from Wiggers et al DAC 2007 paper.", algorithms::compute_backpressure_memory_sizing); #endif /* BACKPRESSURE_H_ */ diff --git a/src/libkiter/algorithms/buffersizing/periodic.h b/src/libkiter/algorithms/buffersizing/periodic.h index ac926cb..fee8634 100644 --- a/src/libkiter/algorithms/buffersizing/periodic.h +++ b/src/libkiter/algorithms/buffersizing/periodic.h @@ -21,6 +21,7 @@ namespace algorithms { ADD_BUFFER_SIZING(PeriodicSizing, - buffer_sizing_action_t({ "PeriodicSizing" , "Minimal Buffer size estimation by periodic scheduling method.", algorithms::compute_csdf_1periodic_memory})); + "Minimal Buffer size estimation by periodic scheduling method.", + algorithms::compute_csdf_1periodic_memory); #endif /* THROUGHPUT_H_ */ diff --git a/src/libkiter/algorithms/buffersizing/periodic_fixed.h b/src/libkiter/algorithms/buffersizing/periodic_fixed.h index 29bfe56..3d6bcb9 100644 --- a/src/libkiter/algorithms/buffersizing/periodic_fixed.h +++ b/src/libkiter/algorithms/buffersizing/periodic_fixed.h @@ -40,12 +40,8 @@ namespace algorithms { } // end of namespace algorithms //Buffer sizing techniques -ADD_BUFFER_SIZING(SPeriodicSizing, -buffer_sizing_action_t({ "SPeriodicSizing" , "Minimal Buffer size estimation by periodic scheduling with StrictlyPeriodic policy.", algorithms::compute_strictly_periodic_memory})); -ADD_BUFFER_SIZING(FixedOffsetBufferSizing, - buffer_sizing_action_t({ "FixedOffsetBufferSizing" , "Minimal Buffer size estimation by periodic scheduling with fixed offset buffer sizing techniques (BURST, AVERAGE, MINMAX, WIGGERS). Define chosen sizing technique as parameter.", algorithms::compute_fixed_offset_buffer_sizing})); - -ADD_TRANSFORMATION(AddVBuffers, -transformation_action_t({ "AddVBuffers" , "Add virtual buffers for each edge in dataflow graph", algorithms::add_vbuffers})); +ADD_BUFFER_SIZING(SPeriodicSizing, "Minimal Buffer size estimation by periodic scheduling with StrictlyPeriodic policy.", algorithms::compute_strictly_periodic_memory); +ADD_BUFFER_SIZING(FixedOffsetBufferSizing, "Minimal Buffer size estimation by periodic scheduling with fixed offset buffer sizing techniques (BURST, AVERAGE, MINMAX, WIGGERS). Define chosen sizing technique as parameter.", algorithms::compute_fixed_offset_buffer_sizing); +ADD_TRANSFORMATION(AddVBuffers, "Add virtual buffers for each edge in dataflow graph", algorithms::add_vbuffers); #endif /* PERIODIC_FIXED_H_ */ diff --git a/src/libkiter/algorithms/dse/ThroughputBufferingDSE.h b/src/libkiter/algorithms/dse/ThroughputBufferingDSE.h index 57e7596..831746a 100644 --- a/src/libkiter/algorithms/dse/ThroughputBufferingDSE.h +++ b/src/libkiter/algorithms/dse/ThroughputBufferingDSE.h @@ -57,11 +57,8 @@ namespace algorithms { ADD_THROUGHPUT_BUFFERING_DSE(throughputbufferingDSE, - throughput_buffering_dse_action_t({ - "throughputbufferingDSE", "DSE that solve the throughputbuffering problem for a graph with \"feedback\" buffers", - algorithms::dse::throughput_buffering_dse} - )); + algorithms::dse::throughput_buffering_dse); diff --git a/src/libkiter/algorithms/dse/deep_dse.h b/src/libkiter/algorithms/dse/deep_dse.h index 37c77ed..ff1df71 100644 --- a/src/libkiter/algorithms/dse/deep_dse.h +++ b/src/libkiter/algorithms/dse/deep_dse.h @@ -27,7 +27,6 @@ std::pair> get_next_storage_distribu const std::map& matching, const std::map & minStepSizes, bool approx) ; StorageDistribution update_storage_distribution_from_cc(const StorageDistribution &sd_g, const StorageDistribution& sd_cc); -ADD_THROUGHPUT_BUFFERING_DSE(DeepKPeriodicThroughputwithDSE, - throughput_buffering_dse_action_t({"DeepKPeriodicThroughputwithDSE", "Experiment", algorithms::deep_dse_user})); +ADD_THROUGHPUT_BUFFERING_DSE(DeepKPeriodicThroughputwithDSE, "Experiment", algorithms::deep_dse_user); #endif //KITER_DEEP_DSE_H diff --git a/src/libkiter/algorithms/dse/dichotomous_search.h b/src/libkiter/algorithms/dse/dichotomous_search.h index 83d371d..00d2341 100644 --- a/src/libkiter/algorithms/dse/dichotomous_search.h +++ b/src/libkiter/algorithms/dse/dichotomous_search.h @@ -23,8 +23,6 @@ namespace algorithms { StorageDistributionSet compute_csdf_dse_from_function (models::Dataflow* const dataflow, const BufferSizingFun& sizing_fun, std::ostream& dseLog) ; } -ADD_THROUGHPUT_BUFFERING_DSE(PeriodicDSE, - throughput_buffering_dse_action_t({ "PeriodicDSE" , "Bodin2013 Periodic DSE", algorithms::compute_csdf_dse_periodic})); -ADD_THROUGHPUT_BUFFERING_DSE(SPeriodicDSE, - throughput_buffering_dse_action_t({ "SPeriodicDSE" , "Experimental Strictly Periodic DSE", algorithms::compute_csdf_dse_speriodic})); +ADD_THROUGHPUT_BUFFERING_DSE(PeriodicDSE, "Bodin2013 Periodic DSE", algorithms::compute_csdf_dse_periodic); +ADD_THROUGHPUT_BUFFERING_DSE(SPeriodicDSE,"Experimental Strictly Periodic DSE", algorithms::compute_csdf_dse_speriodic); #endif /* SRC_LIBKITER_ALGORITHMS_DSE_DICHOTOMOUS_SEARCH_H_ */ diff --git a/src/libkiter/algorithms/dse/kperiodic.h b/src/libkiter/algorithms/dse/kperiodic.h index 0cc73bf..ccb6de8 100644 --- a/src/libkiter/algorithms/dse/kperiodic.h +++ b/src/libkiter/algorithms/dse/kperiodic.h @@ -47,8 +47,7 @@ void updateGraphwMatching(models::Dataflow* dataflow, const std::map& -ADD_THROUGHPUT_BUFFERING_DSE(KPeriodicThroughputwithDSE, - throughput_buffering_dse_action_t({"KPeriodicThroughputwithDSE", "Combine buffer space exploration with throughput evaluation of CSDF by K-periodic scheduling method", algorithms::compute_Kperiodic_throughput_dse_sd})); +ADD_THROUGHPUT_BUFFERING_DSE(KPeriodicThroughputwithDSE, "Combine buffer space exploration with throughput evaluation of CSDF by K-periodic scheduling method", algorithms::compute_Kperiodic_throughput_dse_sd); #endif /* SRC_LIBKITER_ALGORITHMS_DSE_KPERIODIC_H_ */ diff --git a/src/libkiter/algorithms/experiments/expansion_experiment.h b/src/libkiter/algorithms/experiments/expansion_experiment.h index 7307d4a..54a9135 100644 --- a/src/libkiter/algorithms/experiments/expansion_experiment.h +++ b/src/libkiter/algorithms/experiments/expansion_experiment.h @@ -19,5 +19,4 @@ void generate_expansion (models::Dataflow* const dataflow, parameters_lis } -ADD_TRANSFORMATION(PartialExpansion, - transformation_action_t({ "PartialExpansion" , "Generate the Partial Expansion Graph from WIP.", algorithms::generate_expansion})); +ADD_TRANSFORMATION(PartialExpansion,"Generate the Partial Expansion Graph from WIP.", algorithms::generate_expansion); diff --git a/src/libkiter/algorithms/liveness/LivenessModularDSE.h b/src/libkiter/algorithms/liveness/LivenessModularDSE.h index 498f5ae..6a00b33 100644 --- a/src/libkiter/algorithms/liveness/LivenessModularDSE.h +++ b/src/libkiter/algorithms/liveness/LivenessModularDSE.h @@ -34,11 +34,8 @@ namespace algorithms { ADD_THROUGHPUT_BUFFERING_DSE(LivenessDSE, - throughput_buffering_dse_action_t({ - "LivenessDSE" , "DSE that solve the liveness problem for a graph with \"feedback\" buffers", - algorithms::dse::liveness_dse} - )); + algorithms::dse::liveness_dse); #endif //KITER_LIVENESS_MODULAR_DSE_H diff --git a/src/libkiter/algorithms/liveness/SC.h b/src/libkiter/algorithms/liveness/SC.h index 8e08ebc..15b3a50 100644 --- a/src/libkiter/algorithms/liveness/SC.h +++ b/src/libkiter/algorithms/liveness/SC.h @@ -20,8 +20,7 @@ namespace algorithms { } } -ADD_ANALYSIS(LivenessSC, - analysis_action_t({ "LivenessSC" , "Use the SC1 and SC2 liveness condition to check liveness over a dataflow (Benazouz, DAC13).", algorithms::liveness::LivenessSC})); +ADD_ANALYSIS(LivenessSC, "Use the SC1 and SC2 liveness condition to check liveness over a dataflow (Benazouz, DAC13).", algorithms::liveness::LivenessSC); diff --git a/src/libkiter/algorithms/mappings.h b/src/libkiter/algorithms/mappings.h index e5c4379..172d66e 100644 --- a/src/libkiter/algorithms/mappings.h +++ b/src/libkiter/algorithms/mappings.h @@ -38,31 +38,15 @@ namespace algorithms { } // Helpers to map vertex to cores, need a way to also consider routers -ADD_TRANSFORMATION(createNoC, - transformation_action_t({ "createNoC" , "Create NoC based on file inserted", algorithms::mapping::createNoC} ) -); -ADD_TRANSFORMATION(randomMapping, - transformation_action_t({ "randomMapping" , "This command will associate a mapping to each task of the graph. Task unspecified as parameters will be randomly allocated to a core.", algorithms::mapping::randomMapping} ) -); -ADD_TRANSFORMATION(generateTDMA, - transformation_action_t({ "generateTDMA" , "Change seed.", algorithms::mapping::generateTDMA} ) -); -ADD_TRANSFORMATION(moduloMapping, - transformation_action_t({ "moduloMapping" , "This command will associate a mapping to each task of the graph. Task unspecified as parameters will be randomly allocated to a core.", algorithms::mapping::moduloMapping} ) -); -ADD_TRANSFORMATION(BufferlessNoCMapAndRoute, - transformation_action_t({ "BufferlessNoCMapAndRoute" , "Mapping and Routing combined.", algorithms::mapping::BufferlessNoCMapAndRoute} ) -); -ADD_TRANSFORMATION(xyRouting, - transformation_action_t({ "xyRouting" , "Create X-Y routing", algorithms::mapping::xyRouting} ) -); - -ADD_TRANSFORMATION(randomRouting, - transformation_action_t({ "randomRouting" , "Create random X-Y routing", algorithms::mapping::randomRouting} ) -); -ADD_TRANSFORMATION(ModelNoCConflictFreeCommunication, - transformation_action_t({ "ModelNoCConflictFreeCommunication" , "Given a graph with Mapping, can add fictive task to model network", algorithms::ModelNoCConflictFreeCommunication} ) -); +ADD_TRANSFORMATION(createNoC, "Create NoC based on file inserted", algorithms::mapping::createNoC); +ADD_TRANSFORMATION(randomMapping, "This command will associate a mapping to each task of the graph. Task unspecified as parameters will be randomly allocated to a core.", algorithms::mapping::randomMapping); +ADD_TRANSFORMATION(generateTDMA, "Change seed.", algorithms::mapping::generateTDMA); +ADD_TRANSFORMATION(moduloMapping, "This command will associate a mapping to each task of the graph. Task unspecified as parameters will be randomly allocated to a core.", algorithms::mapping::moduloMapping); +ADD_TRANSFORMATION(BufferlessNoCMapAndRoute, "Mapping and Routing combined.", algorithms::mapping::BufferlessNoCMapAndRoute); +ADD_TRANSFORMATION(xyRouting, "Create X-Y routing", algorithms::mapping::xyRouting); + +ADD_TRANSFORMATION(randomRouting, "Create random X-Y routing", algorithms::mapping::randomRouting); +ADD_TRANSFORMATION(ModelNoCConflictFreeCommunication , "Given a graph with Mapping, can add fictive task to model network", algorithms::ModelNoCConflictFreeCommunication); #endif diff --git a/src/libkiter/algorithms/scheduling/TDMAScheduler.h b/src/libkiter/algorithms/scheduling/TDMAScheduler.h index f43ad0b..fa18974 100644 --- a/src/libkiter/algorithms/scheduling/TDMAScheduler.h +++ b/src/libkiter/algorithms/scheduling/TDMAScheduler.h @@ -122,7 +122,6 @@ void TDMASchedule (models::Dataflow* const , parameters_list_t parameters ) } -ADD_ANALYSIS(TDMASchedule, - analysis_action_t({ "TDMASchedule" , "Execute the TDMA schedule for given list of packets", algorithms::scheduling::TDMASchedule})); +ADD_ANALYSIS(TDMASchedule, "Execute the TDMA schedule for given list of packets", algorithms::scheduling::TDMASchedule); #endif /* SRC_LIBKITER_ALGORITHMS_SCHEDULING_TDMASCHEDULER_H_ */ diff --git a/src/libkiter/algorithms/schedulings.h b/src/libkiter/algorithms/schedulings.h index 89cacaa..18cd7bb 100644 --- a/src/libkiter/algorithms/schedulings.h +++ b/src/libkiter/algorithms/schedulings.h @@ -75,39 +75,17 @@ models::Scheduling BufferlessNoCScheduling(models::Dataflow* const dataflow, pa // Recent stuff -ADD_SCHEDULING(REALLP1, -scheduling_action_t({ "REALLP1" , "Fully periodic scheduling for CSDF inefficient way", algorithms::scheduling::CSDF_Real1PeriodicScheduling_LP})); - -ADD_SCHEDULING(LP1, -scheduling_action_t({ "LP1" , "Rewriting Bodin2016 Threshold CSDF 1-Periodic Scheduling with Bufferless channel using Linear Programming", algorithms::scheduling::CSDF_1PeriodicScheduling_LP})); -ADD_SCHEDULING(LPN, -scheduling_action_t({ "LPN" , "Rewriting Bodin2016 Threshold CSDF N-Periodic Scheduling with Bufferless channel using Linear Programming", algorithms::scheduling::CSDF_NPeriodicScheduling_LP})); - -ADD_THROUGHPUT(EG1, -throughput_action_t({ "EG1" , "Rewriting Bodin2013 CSDF 1-Periodic Scheduling", algorithms::scheduling::CSDF_1PeriodicThroughput})); -ADD_THROUGHPUT(EGN, -throughput_action_t({ "EGN" , "Rewriting Bodin2013 CSDF N-Periodic Scheduling", algorithms::scheduling::CSDF_NPeriodicThroughput})); -ADD_SCHEDULING(BufferlessKPeriodicScheduling, - scheduling_action_t({ "BufferlessKPeriodicScheduling" , "Run Bufferless Kperiodic", algorithms::scheduling::bufferlessKPeriodicScheduling} ) - ); - - - -ADD_SCHEDULING(SPeriodicScheduling, -scheduling_action_t({ "SPeriodicScheduling" , "Experimental", algorithms::scheduling::SPeriodicScheduling})); - -ADD_SCHEDULING(OnePeriodicScheduling, -scheduling_action_t({ "1PeriodicScheduling" , "CSDF 1-Periodic Scheduling [Bodin2013]", algorithms::scheduling::OnePeriodicScheduling})); - -ADD_SCHEDULING(ASAPScheduling, -scheduling_action_t({ "ASAPScheduling" , "Symbolic Execution", algorithms::scheduling::ASAPScheduling})); - -ADD_SCHEDULING(So4Scheduling, -scheduling_action_t({ "So4Scheduling" , "Symbolic Execution with TDMA", algorithms::scheduling::So4Scheduling})); - -// Throughput techniques -ADD_SCHEDULING(BufferlessNoCScheduling, - scheduling_action_t({ "BufferlessNoCScheduling" , "BufferlessNoCScheduling, WIP", algorithms::BufferlessNoCScheduling})); +ADD_SCHEDULING(REALLP1, "Fully periodic scheduling for CSDF inefficient way", algorithms::scheduling::CSDF_Real1PeriodicScheduling_LP); +ADD_SCHEDULING(LP1,"Rewriting Bodin2016 Threshold CSDF 1-Periodic Scheduling with Bufferless channel using Linear Programming", algorithms::scheduling::CSDF_1PeriodicScheduling_LP); +ADD_SCHEDULING(LPN, "Rewriting Bodin2016 Threshold CSDF N-Periodic Scheduling with Bufferless channel using Linear Programming", algorithms::scheduling::CSDF_NPeriodicScheduling_LP); +ADD_THROUGHPUT(EG1,"Rewriting Bodin2013 CSDF 1-Periodic Scheduling", algorithms::scheduling::CSDF_1PeriodicThroughput); +ADD_THROUGHPUT(EGN,"Rewriting Bodin2013 CSDF N-Periodic Scheduling", algorithms::scheduling::CSDF_NPeriodicThroughput); +ADD_SCHEDULING(BufferlessKPeriodicScheduling, "Run Bufferless Kperiodic", algorithms::scheduling::bufferlessKPeriodicScheduling); +ADD_SCHEDULING(SPeriodicScheduling,"Experimental", algorithms::scheduling::SPeriodicScheduling); +ADD_SCHEDULING(OnePeriodicScheduling,"CSDF 1-Periodic Scheduling [Bodin2013]", algorithms::scheduling::OnePeriodicScheduling); +ADD_SCHEDULING(ASAPScheduling,"Symbolic Execution", algorithms::scheduling::ASAPScheduling); +ADD_SCHEDULING(So4Scheduling,"Symbolic Execution with TDMA", algorithms::scheduling::So4Scheduling); +ADD_SCHEDULING(BufferlessNoCScheduling, "BufferlessNoCScheduling, WIP", algorithms::BufferlessNoCScheduling); #endif /* SRC_LIBKITER_ALGORITHMS_SCHEDULINGS_H_ */ diff --git a/src/libkiter/algorithms/software_noc.h b/src/libkiter/algorithms/software_noc.h index 8aee0fb..7edf479 100644 --- a/src/libkiter/algorithms/software_noc.h +++ b/src/libkiter/algorithms/software_noc.h @@ -26,9 +26,7 @@ namespace algorithms { bool isConflictPresent(LARGE_INT HP, TIME_UNIT si, LARGE_INT ni, TIME_UNIT sj, LARGE_INT nj); } -ADD_TRANSFORMATION(SoftwareControlledNoCBufferless, - transformation_action_t({"SoftwareControlledNoCBufferless" , "Perform Bufferless NoC scheduling after deciding task mapping and routing.", algorithms::software_noc_bufferless}) -); +ADD_TRANSFORMATION(SoftwareControlledNoCBufferless, "Perform Bufferless NoC scheduling after deciding task mapping and routing.", algorithms::software_noc_bufferless); diff --git a/src/libkiter/algorithms/symbolic_execution.h b/src/libkiter/algorithms/symbolic_execution.h index cf33cc9..6f42cf8 100644 --- a/src/libkiter/algorithms/symbolic_execution.h +++ b/src/libkiter/algorithms/symbolic_execution.h @@ -18,10 +18,8 @@ namespace algorithms { void packet_list(models::Dataflow* const dataflow, parameters_list_t ) ; } -ADD_ANALYSIS(SymbolicExecutionWP, - analysis_action_t({ "SymbolicExecutionWP" , "Execute task in ASAP fashion and print out the scheduling.", algorithms::symbolic_execution_with_packets})); -ADD_ANALYSIS(SymbolicExecution, - analysis_action_t({ "SymbolicExecution" , "Execute task in ASAP fashion.", algorithms::symbolic_execution})); +ADD_ANALYSIS(SymbolicExecutionWP, "Execute task in ASAP fashion and print out the scheduling.", algorithms::symbolic_execution_with_packets); +ADD_ANALYSIS(SymbolicExecution,"Execute task in ASAP fashion.", algorithms::symbolic_execution); diff --git a/src/libkiter/algorithms/throughput/csdf_strictly_periodic.h b/src/libkiter/algorithms/throughput/csdf_strictly_periodic.h index b984242..866127f 100644 --- a/src/libkiter/algorithms/throughput/csdf_strictly_periodic.h +++ b/src/libkiter/algorithms/throughput/csdf_strictly_periodic.h @@ -22,7 +22,5 @@ namespace algorithms { } -ADD_THROUGHPUT(SPeriodicThroughput, - throughput_action_t({ "SPeriodicThroughput" , "Strictly Periodic schedule (Exact)", algorithms::compute_SPeriodic_throughput})); -ADD_THROUGHPUT(ASPeriodicThroughput, - throughput_action_t({ "ASPeriodicThroughput" , "Strictly Periodic schedule (Approx)", algorithms::compute_ASPeriodic_throughput})); +ADD_THROUGHPUT(SPeriodicThroughput,"Strictly Periodic schedule (Exact)", algorithms::compute_SPeriodic_throughput); +ADD_THROUGHPUT(ASPeriodicThroughput,"Strictly Periodic schedule (Approx)", algorithms::compute_ASPeriodic_throughput); diff --git a/src/libkiter/algorithms/throughput/degroote.h b/src/libkiter/algorithms/throughput/degroote.h index a2f7dae..59f2666 100644 --- a/src/libkiter/algorithms/throughput/degroote.h +++ b/src/libkiter/algorithms/throughput/degroote.h @@ -26,10 +26,8 @@ void clean_LCG (models::EventGraph* } -ADD_THROUGHPUT(deGrooteThroughput, - throughput_action_t({ "deGrooteThroughput" , "Throughput analysis from deGroote2012 paper except event graph reduction.", algorithms::compute_deGroote_throughput})); +ADD_THROUGHPUT(deGrooteThroughput,"Throughput analysis from deGroote2012 paper except event graph reduction.", algorithms::compute_deGroote_throughput); -ADD_THROUGHPUT(deGrooteCleanThroughput, - throughput_action_t({ "deGrooteCleanThroughput" , "Throughput analysis from deGroote2012 paper.", algorithms::compute_deGrooteClean_throughput})); +ADD_THROUGHPUT(deGrooteCleanThroughput,"Throughput analysis from deGroote2012 paper.", algorithms::compute_deGrooteClean_throughput); #endif /* DEGROOTE_H_ */ diff --git a/src/libkiter/algorithms/throughput/kperiodic.h b/src/libkiter/algorithms/throughput/kperiodic.h index b6dfdc9..97ce87c 100644 --- a/src/libkiter/algorithms/throughput/kperiodic.h +++ b/src/libkiter/algorithms/throughput/kperiodic.h @@ -51,19 +51,14 @@ TIME_UNIT compute_Kperiodic_throughput (models::Data bool updateVectorWithFineNi (models::Dataflow * const , periodicity_vector_t * , critical_circuit_t * ); } -ADD_THROUGHPUT(KPeriodicThroughput, - throughput_action_t({ "KPeriodicThroughput" , "Optimal Throughput evaluation of CSDF by K-Periodic scheduling method 2.", algorithms::compute_Kperiodic_throughput})); +ADD_THROUGHPUT(KPeriodicThroughput,"Optimal Throughput evaluation of CSDF by K-Periodic scheduling method 2.", algorithms::compute_Kperiodic_throughput); -ADD_THROUGHPUT(UnPeriodicThroughput, - throughput_action_t({ "1PeriodicThroughput" , "Optimal 1-Periodic Throughput evaluation of CSDF by K-Periodic scheduling method.", algorithms::compute_1Kperiodic_throughput})); -ADD_THROUGHPUT(DeuxPeriodicThroughput, - throughput_action_t({ "2PeriodicThroughput" , "Optimal 1-Periodic Throughput evaluation of CSDF by K-Periodic scheduling method.", algorithms::compute_2Kperiodic_throughput})); -ADD_THROUGHPUT(NKPeriodicThroughput, - throughput_action_t({ "NKPeriodicThroughput" , "Optimal Throughput evaluation of CSDF by using N-periodic method.", algorithms::compute_NKperiodic_throughput})); +ADD_THROUGHPUT(UnPeriodicThroughput,"Optimal 1-Periodic Throughput evaluation of CSDF by K-Periodic scheduling method.", algorithms::compute_1Kperiodic_throughput); +ADD_THROUGHPUT(DeuxPeriodicThroughput,"Optimal 1-Periodic Throughput evaluation of CSDF by K-Periodic scheduling method.", algorithms::compute_2Kperiodic_throughput); +ADD_THROUGHPUT(NKPeriodicThroughput,"Optimal Throughput evaluation of CSDF by using N-periodic method.", algorithms::compute_NKperiodic_throughput); -ADD_PRINTER(PrintKPeriodicScheduling, - printer_action_t({ "PrintKPeriodicScheduling" , "Print KPeriodicScheduling", algorithms::print_kperiodic_scheduling}) -); +ADD_PRINTER(PrintKPeriodicScheduling, "Print KPeriodicScheduling", algorithms::print_kperiodic_scheduling); + #endif /* KPERIODIC_H_ */ diff --git a/src/libkiter/algorithms/throughput/symbolic_execution.h b/src/libkiter/algorithms/throughput/symbolic_execution.h index 3136f60..2bcfbb8 100644 --- a/src/libkiter/algorithms/throughput/symbolic_execution.h +++ b/src/libkiter/algorithms/throughput/symbolic_execution.h @@ -51,9 +51,7 @@ namespace algorithms { } -ADD_THROUGHPUT(SymbExec, - throughput_action_t({ "SymbExec" , "Execute graph using ASAP scheduling.", algorithms::compute_asap_throughput})); -ADD_THROUGHPUT(SymbExecDebug, - throughput_action_t({ "SymbExecDebug" , "Test SymbExec with preset storage distribution.", algorithms::compute_asap_throughput_and_cycles_debug})); +ADD_THROUGHPUT(SymbExec, "Execute graph using ASAP scheduling.", algorithms::compute_asap_throughput); +ADD_THROUGHPUT(SymbExecDebug, "Test SymbExec with preset storage distribution.", algorithms::compute_asap_throughput_and_cycles_debug); #endif /* SYMBOLIC_EXECUTION_H_ */ diff --git a/src/libkiter/algorithms/transformation/AddFeedbackBuffers.h b/src/libkiter/algorithms/transformation/AddFeedbackBuffers.h index 8b09364..c761818 100644 --- a/src/libkiter/algorithms/transformation/AddFeedbackBuffers.h +++ b/src/libkiter/algorithms/transformation/AddFeedbackBuffers.h @@ -16,10 +16,8 @@ namespace algorithms { } ADD_TRANSFORMATION(AddFeedbackBuffers, - transformation_action_t({ - "AddFeedbackBuffers", "Add feedback buffer for any non-feedback buffers.", - algorithms::transformation::add_feedback_buffers})); + algorithms::transformation::add_feedback_buffers); #endif //KITER_ADDFEEDBACKBUFFERS_H diff --git a/src/libkiter/algorithms/transformation/addInOutLoop.h b/src/libkiter/algorithms/transformation/addInOutLoop.h index bb2d8dd..290bad4 100644 --- a/src/libkiter/algorithms/transformation/addInOutLoop.h +++ b/src/libkiter/algorithms/transformation/addInOutLoop.h @@ -25,8 +25,6 @@ namespace algorithms { } } -ADD_TRANSFORMATION(AddIOLoop, - transformation_action_t({ "AddIOLoop" , "Take any output tasks and connect it to any input task. Weights only works for HSDFG.", algorithms::transformation::add_input_output_loop})); - +ADD_TRANSFORMATION(AddIOLoop, "Take any output tasks and connect it to any input task. Weights only works for HSDFG.", algorithms::transformation::add_input_output_loop); #endif //KITER_ADDINOUTLOOP_H diff --git a/src/libkiter/algorithms/transformation/merging.h b/src/libkiter/algorithms/transformation/merging.h index b7e43d9..d22cf48 100644 --- a/src/libkiter/algorithms/transformation/merging.h +++ b/src/libkiter/algorithms/transformation/merging.h @@ -30,6 +30,5 @@ namespace algorithms { } } -ADD_TRANSFORMATION(Merge, - transformation_action_t({ "Merge" , "Merging tasks using Kperiodic scheduling and Initialization phases", algorithms::transformation::merge_tasks})); +ADD_TRANSFORMATION(Merge,"Merging tasks using Kperiodic scheduling and Initialization phases", algorithms::transformation::merge_tasks); #endif /* SRC_LIBKITER_ALGORITHMS_TRANSFORMATION_MERGING_H_ */ diff --git a/src/libkiter/algorithms/transformation/normalize.h b/src/libkiter/algorithms/transformation/normalize.h index 10afbe7..afab2be 100644 --- a/src/libkiter/algorithms/transformation/normalize.h +++ b/src/libkiter/algorithms/transformation/normalize.h @@ -20,7 +20,6 @@ namespace algorithms { } } -ADD_TRANSFORMATION(RemoveReentrancy, - transformation_action_t({ "Normalize" , "Transform the graph such that it is normalized.", algorithms::transformation::apply_normalization})); +ADD_TRANSFORMATION(RemoveReentrancy, "Transform the graph such that it is normalized.", algorithms::transformation::apply_normalization); #endif //KITER_NORMALIZE_H diff --git a/src/libkiter/algorithms/transformation/remove_reentrancy.h b/src/libkiter/algorithms/transformation/remove_reentrancy.h index 02ac717..78d02e5 100644 --- a/src/libkiter/algorithms/transformation/remove_reentrancy.h +++ b/src/libkiter/algorithms/transformation/remove_reentrancy.h @@ -28,8 +28,7 @@ namespace algorithms { } } -ADD_TRANSFORMATION(RemoveReentrancy, - transformation_action_t({ "RemoveReentrancy" , "Set reentrancy to 0 for every task or selected tasks.", algorithms::transformation::remove_reentrancy})); +ADD_TRANSFORMATION(RemoveReentrancy,"Set reentrancy to 0 for every task or selected tasks.", algorithms::transformation::remove_reentrancy); #endif /* SRC_LIBKITER_ALGORITHMS_TRANSFORMATION_REMOVE_REENTRANCY_H_ */ diff --git a/src/libkiter/algorithms/transformation/singleOutput.h b/src/libkiter/algorithms/transformation/singleOutput.h index 731a4d7..a0bba57 100644 --- a/src/libkiter/algorithms/transformation/singleOutput.h +++ b/src/libkiter/algorithms/transformation/singleOutput.h @@ -29,7 +29,6 @@ void singleOutput (models::Dataflow* const dataflow, parameters_list_t param } -ADD_TRANSFORMATION(SingleOutput, - transformation_action_t({ "SingleOutput" , "SingleOutput merging outputs from a HSDF task", algorithms::transformation::singleOutput})); +ADD_TRANSFORMATION(SingleOutput, "SingleOutput merging outputs from a HSDF task", algorithms::transformation::singleOutput); #endif /* SRC_LIBKITER_ALGORITHMS_TRANSFORMATION_SINGLEOUTPUT_H_ */ diff --git a/src/libkiter/algorithms/transformations.h b/src/libkiter/algorithms/transformations.h index 62a0e09..cba4918 100644 --- a/src/libkiter/algorithms/transformations.h +++ b/src/libkiter/algorithms/transformations.h @@ -26,10 +26,8 @@ namespace algorithms { } } -ADD_TRANSFORMATION(remove, - transformation_action_t({"remove" , "Remove tasks with the name or the id specified", algorithms::transformation::remove_task})); -ADD_TRANSFORMATION(bugfix, - transformation_action_t({"bugfix" , "A bugfix tool that try to reduce the size of a graph while keeping anomaly between kiter and SDF3", algorithms::transformation::compare_sdf3_throughput})); +ADD_TRANSFORMATION(remove,"Remove tasks with the name or the id specified", algorithms::transformation::remove_task); +ADD_TRANSFORMATION(bugfix, "A bugfix tool that try to reduce the size of a graph while keeping anomaly between kiter and SDF3", algorithms::transformation::compare_sdf3_throughput); #endif /* SRC_LIBKITER_ALGORITHMS_TRANSFORMATIONS_H_ */ diff --git a/src/libkiter/commons/KiterRegistry.h b/src/libkiter/commons/KiterRegistry.h index edb0fde..50a5d13 100644 --- a/src/libkiter/commons/KiterRegistry.h +++ b/src/libkiter/commons/KiterRegistry.h @@ -18,81 +18,67 @@ typedef std::map parameters_list_t; - -// typedef std::function< BufferSizingResult(models::Dataflow* const, TIME_UNIT) > BufferSizingFun; - - - /** * This part defines KiterRegistry and the different type of actions it can support */ -struct generator_action_t { - std::string name; - std::string desc; - models::Dataflow* (*fun)(parameters_list_t); -}; - -struct transformation_action_t { - std::string name; - std::string desc; - void (*fun)(models::Dataflow*, parameters_list_t); +enum class ActionType { + GENERATOR, + ANALYSIS, + TRANSFORMATION, + SCHEDULING, + THROUGHPUT, + BUFFER_SIZING, + THROUGHPUT_BUFFERING_DSE, + PRINTER, + COUNT // keep this last }; - -struct buffer_sizing_action_t { - std::string name; - std::string desc; - - models::BufferSizingResult (*fun)(models::Dataflow*, parameters_list_t); -}; -struct printer_action_t { - std::string name; - std::string desc; - void (*fun)(models::Dataflow*, parameters_list_t); -}; - -struct scheduling_action_t { - std::string name; - std::string desc; - models::Scheduling (*fun)(models::Dataflow*, parameters_list_t); +// Define the action type mappings +static const std::unordered_map> ActionTypeMappings = { + {ActionType::GENERATOR, {"generator", "-g"}}, + {ActionType::ANALYSIS, {"analysis", "-a"}}, + {ActionType::TRANSFORMATION, {"transformation", "-a"}}, + {ActionType::SCHEDULING, {"scheduling", "-a"}}, + {ActionType::THROUGHPUT, {"throughput", "-a"}}, + {ActionType::BUFFER_SIZING, {"buffer sizing", "-a"}}, + {ActionType::THROUGHPUT_BUFFERING_DSE, {"throughput buffering DSE", "-a"}}, + {ActionType::PRINTER, {"printer", "-a"}} }; -struct analysis_action_t { +// Base struct for demonstration +template +struct BaseAction { std::string name; std::string desc; - void (*fun)(models::Dataflow*, parameters_list_t); + FUNC_T fun; }; -struct throughput_action_t { - std::string name; - std::string desc; - TIME_UNIT (*fun)(models::Dataflow*, parameters_list_t); -}; - - -struct throughput_buffering_dse_action_t { - std::string name; - std::string desc; - StorageDistributionSet (*fun)(models::Dataflow*, parameters_list_t); -}; +struct generator_action_t : BaseAction {}; +struct transformation_action_t : BaseAction {}; +struct buffer_sizing_action_t : BaseAction {}; +struct printer_action_t : BaseAction {}; +struct scheduling_action_t : BaseAction {}; +struct analysis_action_t : BaseAction {}; +struct throughput_action_t : BaseAction {}; +struct throughput_buffering_dse_action_t : BaseAction {}; -#define ADD_KITER_TOOL(name,type,t) static auto name##unique = KiterRegistry::add(t) +#define ADD_KITER_TOOL(n,t,d,f) static auto n##unique = KiterRegistry::add(t({ #n , d, f})) -#define ADD_BUFFER_SIZING(name,t) ADD_KITER_TOOL(name,buffer_sizing_action_t,t) -#define ADD_TRANSFORMATION(name,t) ADD_KITER_TOOL(name,transformation_action_t,t) -#define ADD_THROUGHPUT_BUFFERING_DSE(name,t) ADD_KITER_TOOL(name,throughput_buffering_dse_action_t,t) -#define ADD_ANALYSIS(name,t) ADD_KITER_TOOL(name,analysis_action_t,t) -#define ADD_SCHEDULING(name,t) ADD_KITER_TOOL(name,scheduling_action_t,t) -#define ADD_THROUGHPUT(name,t) ADD_KITER_TOOL(name,throughput_action_t,t) -#define ADD_GENERATOR(name,t) ADD_KITER_TOOL(name,generator_action_t,t) -#define ADD_PRINTER(name,t) ADD_KITER_TOOL(name,printer_action_t,t) +#define ADD_BUFFER_SIZING(n,d,f) ADD_KITER_TOOL(n,buffer_sizing_action_t, d, f) +#define ADD_TRANSFORMATION(n,d,f) ADD_KITER_TOOL(n,transformation_action_t, d, f) +#define ADD_THROUGHPUT_BUFFERING_DSE(n,d,f) ADD_KITER_TOOL(n,throughput_buffering_dse_action_t, d, f) +#define ADD_ANALYSIS(n,d,f) ADD_KITER_TOOL(n,analysis_action_t, d, f) +#define ADD_SCHEDULING(n,d,f) ADD_KITER_TOOL(n,scheduling_action_t, d, f) +#define ADD_THROUGHPUT(n,d,f) ADD_KITER_TOOL(n,throughput_action_t, d, f) +#define ADD_GENERATOR(n,d,f) ADD_KITER_TOOL(n,generator_action_t, d, f) +#define ADD_PRINTER(n,d,f) ADD_KITER_TOOL(n,printer_action_t, d, f) template class KiterRegistry { public: - typedef std::map tools_map; + using tools_map = std::map; static bool add(const T& t) { tools_map& map = getSingletonMap(); @@ -112,50 +98,58 @@ class KiterRegistry { return keys; } - static const T* get(const std::string& name) { tools_map& map = getSingletonMap(); if (map.find(name) == map.end()) return nullptr; return &(map[name]); } + + static void print (std::ostream &out) { - for (auto i : KiterRegistry::getSingletonMap()) { + for (const auto &i : KiterRegistry::getSingletonMap()) { out << " - " << i.second.name << " : " << i.second.desc << std::endl; } } - static void print_all (std::ostream &out) { - out << " List of supported generator (-g) is " << std::endl; - KiterRegistry::print(out); - out << "" << std::endl; - - out << " List of supported buffer sizing algorithms (-a) is " << std::endl; - KiterRegistry::print(out); - out << "" << std::endl; - - out << " List of supported transformation algorithms (-a) is " << std::endl; - KiterRegistry::print(out); - out << "" << std::endl; - - out << " List of supported scheduling algorithms (-a) is " << std::endl; - KiterRegistry::print(out); - out << "" << std::endl; - - out << " List of supported throughput algorithms (-a) is " << std::endl; - KiterRegistry::print(out); - out << "" << std::endl; - - out << " List of supported DSE algorithms (-a) is " << std::endl; - KiterRegistry::print(out); - out << "" << std::endl; - - out << " List of supported analysis algorithms (-a) is " << std::endl; - KiterRegistry::print(out); - out << "" << std::endl; - - out << " List of supported printers (-a) is " << std::endl; - KiterRegistry::print(out); - out << "" << std::endl; + // Print all registries dynamically + static void print_all(std::ostream& out) { + for (int i = 0; i < static_cast(ActionType::COUNT); ++i) { + ActionType actionType = static_cast(i); + const auto& [actionName, actionArgument] = ActionTypeMappings.at(actionType); + + out << " List of supported " << actionName << " (" << actionArgument << ") is:" << std::endl; + + // Dynamically dispatch the correct registry's print method + switch (actionType) { + case ActionType::GENERATOR: + KiterRegistry::print(out); + break; + case ActionType::ANALYSIS: + KiterRegistry::print(out); + break; + case ActionType::TRANSFORMATION: + KiterRegistry::print(out); + break; + case ActionType::SCHEDULING: + KiterRegistry::print(out); + break; + case ActionType::THROUGHPUT: + KiterRegistry::print(out); + break; + case ActionType::BUFFER_SIZING: + KiterRegistry::print(out); + break; + case ActionType::THROUGHPUT_BUFFERING_DSE: + KiterRegistry::print(out); + break; + case ActionType::PRINTER: + KiterRegistry::print(out); + break; + default: + break; + } + out << std::endl; + } } private: diff --git a/src/libkiter/generators/LTEGenerator.h b/src/libkiter/generators/LTEGenerator.h index 95f1a60..cd9484d 100644 --- a/src/libkiter/generators/LTEGenerator.h +++ b/src/libkiter/generators/LTEGenerator.h @@ -35,10 +35,8 @@ namespace generators { models::Dataflow* generate_lte_sdf(parameters_list_t param_list); } -ADD_GENERATOR(genLTESDF, - generator_action_t( - { "genLTESDF" , "generate LTE SDF, parameters are miwf, cwac, ifft, dd.", generators::generate_lte_sdf}) -); +ADD_GENERATOR(genLTESDF, "generate LTE SDF, parameters are miwf, cwac, ifft, dd.", generators::generate_lte_sdf); + diff --git a/src/libkiter/generators/NormalizedCycleGenerator.h b/src/libkiter/generators/NormalizedCycleGenerator.h index 1fa927d..b9bcee1 100644 --- a/src/libkiter/generators/NormalizedCycleGenerator.h +++ b/src/libkiter/generators/NormalizedCycleGenerator.h @@ -24,10 +24,8 @@ namespace generators { } // generators -ADD_GENERATOR(GenerateNormalizedCycle, - generator_action_t( - { "GenerateNormalizedCycle" , "generate a normalized SDF cycle.", generators::generate_normalized_cycle}) -); +ADD_GENERATOR(GenerateNormalizedCycle, "generate a normalized SDF cycle.", generators::generate_normalized_cycle); + #endif //KITER_NORMALIZEDCYCLEGENERATOR_H diff --git a/src/libkiter/generators/RandomGenerator.h b/src/libkiter/generators/RandomGenerator.h index b2d3078..2e6abaf 100644 --- a/src/libkiter/generators/RandomGenerator.h +++ b/src/libkiter/generators/RandomGenerator.h @@ -46,10 +46,8 @@ namespace generators { models::Dataflow* generate_random_sdf(parameters_list_t param_list); } -ADD_GENERATOR(GenerateRandomSDF, - generator_action_t( - { "GenerateRandomSDF" , "generate LTE SDF.", generators::generate_random_sdf}) -); +ADD_GENERATOR(GenerateRandomSDF, "generate LTE SDF.", generators::generate_random_sdf); + diff --git a/src/libkiter/printers/stdout.h b/src/libkiter/printers/stdout.h index 68fd9da..bb0fd2b 100644 --- a/src/libkiter/printers/stdout.h +++ b/src/libkiter/printers/stdout.h @@ -34,20 +34,15 @@ void printInfos (models::Dataflow* const dataflow, parameters_list void printXML (models::Dataflow* const dataflow, parameters_list_t = std::map()); } -ADD_PRINTER(PrintXML, - printer_action_t({ "PrintXML" , "Print XML file", printers::printXML}) -); - -ADD_PRINTER(PrintKiter, - printer_action_t({ "PrintKiter" , "Generate C++ code to internally generate the graph inside Kiter.", printers::printGraphAsKiterScript} ) -); -ADD_PRINTER(PrintInfos, - printer_action_t({ "PrintInfos" , "Just print some graph informations.", printers::printInfos}) -); -ADD_PRINTER(PrintGraph, - printer_action_t({ "PrintGraph" , "Print DOT file", printers::printGraph}) -); -ADD_PRINTER(PrintMapping, - printer_action_t({ "PrintMapping" , "Print DOT file", printers::printMapping}) -); +ADD_PRINTER(PrintXML,"Print XML file", printers::printXML); + + +ADD_PRINTER(PrintKiter,"Generate C++ code to internally generate the graph inside Kiter.", printers::printGraphAsKiterScript); + +ADD_PRINTER(PrintInfos,"Just print some graph informations.", printers::printInfos); + +ADD_PRINTER(PrintGraph,"Print DOT file", printers::printGraph); + +ADD_PRINTER(PrintMapping , "Print DOT file", printers::printMapping); + #endif /* STDOUT_H_ */ diff --git a/tests/BackpressureTest.cpp b/tests/BackpressureTest.cpp index 3034531..6db2cc5 100644 --- a/tests/BackpressureTest.cpp +++ b/tests/BackpressureTest.cpp @@ -10,6 +10,7 @@ #include #include #include "commons/commons.h" +#include // This tests suite might be failing because of inappropriate graphs diff --git a/tests/DsePeriodicTest.cpp b/tests/DsePeriodicTest.cpp index 2f25ea1..d0b3654 100644 --- a/tests/DsePeriodicTest.cpp +++ b/tests/DsePeriodicTest.cpp @@ -10,6 +10,7 @@ #include "helpers/sample.h" #include "helpers/random_generator.h" #include "algorithms/dse/dichotomous_search.h" +#include BOOST_FIXTURE_TEST_SUITE( dse_periodic_test , WITH_SAMPLE)