diff --git a/tools/dvecompile.cpp b/tools/dvecompile.cpp index 2af90b0b5b7f8e9251d1810403a479f881ef902d..5043c2e411b75bb31abff33cb7fd8b4589fe6ae4 100644 --- a/tools/dvecompile.cpp +++ b/tools/dvecompile.cpp @@ -2391,6 +2391,40 @@ void dve_compiler::gen_transition_info() block_end(); line(); + //////////////////////////////////////////////// + // EXPORT DO NOT ACCORD MATRIX // + //////////////////////////////////////////////// + + // guard nes matrix (#guards x #transitions) + snprintf(buf, BUFLEN, "int nda[%zu][%zu] = ", transitions.size(), transitions.size()); + line(buf); + block_begin(); + for(size_int_t i=0; i < transitions.size(); i++) { + append("{"); + for(size_int_t j=0; j < transitions.size(); j++) { + if (j != 0) append(", "); + append(is_nda(transitions[i], transitions[j])?"1":"0"); + } + if (i == guard.size() - 1) + line("}"); + else + line("},"); + } + + block_end(); + line(";"); + line(); + + // guard nes function + line ("extern \"C\" const int* get_nda_matrix(int t) " ); + block_begin(); + snprintf(buf, BUFLEN, "if (t >= 0 && t < %zu) return nda[t];", transitions.size()); + line(buf); + snprintf(buf, BUFLEN, "return NULL;"); + line(buf); + block_end(); + line(); + //////////////////////////////////////////////// // EXPORT NECESSARY DISABLING SETS FOR GUARDS // //////////////////////////////////////////////// @@ -2476,6 +2510,13 @@ bool dve_compiler::is_guard_nds( guard& g, ext_transition_t& t ) { return true; } +bool dve_compiler::is_nda( ext_transition_t& t1, ext_transition_t& t2 ) { + if (t1.) { + + } + return true; +} + bool dve_compiler::may_be_coenabled( guard& ga, guard& gb) { // if type different, return default if (ga.type == gb.type || ga.type == GUARD_COMMITED_FIRST) { diff --git a/tools/dvecompile.h b/tools/dvecompile.h index 4192ce86e2a6b593d299d9061e40052879f9ebc7..7b1bee9f9c443e486029b86c2e05c2832f18f20a 100644 --- a/tools/dvecompile.h +++ b/tools/dvecompile.h @@ -236,6 +236,7 @@ struct dve_compiler: public dve_explicit_system_t bool get_const_expression( dve_expression_t & expr, int & value); bool is_guard_nes( guard& g, ext_transition_t& t ); bool is_guard_nds( guard& g, ext_transition_t& t ); + bool dve_compiler::is_nda( ext_transition_t& t1, ext_transition_t& t2); bool may_be_coenabled( guard& ga, guard& gb); void extract_predicates( std::vector& p, dve_expression_t& e); bool is_conflict_predicate(simple_predicate& p1, simple_predicate p2);