Changeset 47


Ignore:
Timestamp:
Oct 26, 2009, 7:07:37 PM (15 years ago)
Author:
buchmann
Message:

This patch simplifies SystemCASS.

Remove:

  • ckeckings about multiwriting on registers and ports
  • checkings related to FSM modeling
  • regression tests related to the checkings
Location:
sources
Files:
4 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • sources/configure.ac

    r41 r47  
    3737                         )])
    3838
    39 MY_ARG_ENABLE(check_fsm_rules, [Enable FSM rule checking], [no])
    40 MY_ARG_ENABLE(check_multiwriting2port, [Report if port is written twice], [no])
    41 MY_ARG_ENABLE(check_multiwriting2register, [Report if unconnected signal is written twice], [no])
    4239MY_ARG_ENABLE(debug, [Enable debugging], [no])
    4340
  • sources/src/casc.h

    r37 r47  
    3838#ifdef SCHEDULING_BY_CASC
    3939#include <systemcass_version_ext.h>
    40 #include <fsm_rules.h>
    4140
    4241namespace sc_core {
     
    4948EXTERN void simulate_1_cycle (void)
    5049{
    51 #ifdef CONFIG_CHECK_FSM_RULES
    52   casc_fsm_step = TRANSITION;
    53 #endif
    5450  transition ();
    5551  update     ();
    56 #ifdef CONFIG_CHECK_FSM_RULES
    57   casc_fsm_step = GEN_MOORE;
    58 #endif
    5952  moore_generation ();
    60 #ifdef CONFIG_CHECK_FSM_RULES
    61   casc_fsm_step = GEN_MEALY;
    62 #endif
    6353  mealy_generation ();
    64 #ifdef CONFIG_CHECK_FSM_RULES
    65   casc_fsm_step = STIMULI;
    66 #endif
    6754}
    6855} // end of sc_core namespace
  • sources/src/dump_used_options.cc

    r42 r47  
    6868  "DUMP_STAGE, "
    6969#endif
    70 #ifdef CONFIG_CHECK_FSM_RULES     
    71   "CONFIG_CHECK_FSM_RULES, "
    72 #endif
    73 #ifdef CONFIG_CHECK_MULTIWRITING2PORT     
    74   "CONFIG_CHECK_MULTIWRITING2PORT, "
    75 #endif
    76 #ifdef CONFIG_CHECK_MULTIWRITING2REGISTER     
    77   "CONFIG_CHECK_MULTIWRITING2REGISTER, "
    78 #endif
    7970#ifdef CONFIG_DEFAULT_RUNTIME_COMPILATION     
    8071  "CONFIG_DEFAULT_RUNTIME_COMPILATION, "
  • sources/src/gen_code.cc

    r41 r47  
    5858#endif
    5959
    60 #ifdef CONFIG_CHECK_FSM_RULES
    61 #include "fsm_rules.h"
    62 #define fsm_check_flag "-DCONFIG_CHECK_FSM_RULES"
    63 #else
    64 #define fsm_check_flag
    65 #endif
    66 
    67 #define casc_cflags GENERATED_MODULE_CFLAGS " " fsm_check_flag
     60#define casc_cflags GENERATED_MODULE_CFLAGS
    6861
    6962// Enable CPP call, this is useful for typeinfo-enabled classes
     
    608601void static_simulate_1_cycle (void)
    609602{
    610 #ifdef CONFIG_CHECK_FSM_RULES
    611   casc_fsm_step = TRANSITION;
    612 #endif
    613603  call_functions (pf[0]); // transition
    614604  update     ();
    615 #ifdef CONFIG_CHECK_FSM_RULES
    616   casc_fsm_step = GEN_MOORE;
    617 #endif
    618605  call_functions_in_parallel (pf[1]); // moore generation
    619 #ifdef CONFIG_CHECK_FSM_RULES
    620   casc_fsm_step = GEN_MEALY;
    621 #endif
    622606  call_functions (pf[2]); // mealy generation
    623 #ifdef CONFIG_CHECK_FSM_RULES
    624   casc_fsm_step = STIMULI;
    625 #endif
    626607}
    627608
     
    668649void quasistatic_simulate_1_cycle (void)
    669650{
    670 #ifdef CONFIG_CHECK_FSM_RULES
    671   casc_fsm_step = TRANSITION;
    672 #endif
    673651  method_process_list_t::iterator mm;
    674652  for( mm = func_list[0].begin(); mm != func_list[0].end(); ++mm)
     
    678656  }
    679657  update     ();
    680 #ifdef CONFIG_CHECK_FSM_RULES
    681   casc_fsm_step = GEN_MOORE;
    682 #endif
    683658  for( mm = func_list[1].begin(); mm != func_list[1].end(); ++mm)
    684659  {
     
    686661    Call (m);
    687662  }
    688 #ifdef CONFIG_CHECK_FSM_RULES
    689   casc_fsm_step = GEN_MEALY;
    690 #endif
    691663  quasistatic_mealy_generation ();
    692 #ifdef CONFIG_CHECK_FSM_RULES
    693   casc_fsm_step = STIMULI;
    694 #endif
    695664}
    696665
  • sources/src/gen_code.h

    r27 r47  
    121121#endif
    122122        update ();
    123 #ifdef CONFIG_CHECK_FSM_RULES
    124                 casc_fsm_step = GEN_MEALY;
    125 #endif
    126123    func_combinationals ();
    127124  }
     
    132129  if (is_posted_write ()) {
    133130    update ();
    134 #ifdef CONFIG_CHECK_FSM_RULES
    135                 casc_fsm_step = GEN_MEALY;
    136 #endif
    137131    func_combinationals ();
    138132  }
  • sources/src/global_functions.cc

    r42 r47  
    4949#endif
    5050
    51 #ifdef CONFIG_CHECK_FSM_RULES
    52 #include "fsm_rules.h"
    53 #endif
    54 
    5551using namespace std;
    5652
     
    264260
    265261  // Init variables to be able to run combinational functions
    266 #ifdef CONFIG_CHECK_FSM_RULES
    267   casc_fsm_step = STIMULI;
    268 #endif
    269 
    270262  pending_write_vector_capacity = get_signal_table_size ();
    271 #if 0
    272   cerr << "pending_write_vector_capacity = " << pending_write_vector_capacity
    273 << "\n";
    274 #endif
     263
    275264  if (pending_write_vector_capacity == 0)
    276265    pending_write_vector = NULL;
  • sources/src/sc_port.cc

    r35 r47  
    5757
    5858using namespace std;
    59 
    60 #ifdef CONFIG_CHECK_FSM_RULES
    61 #include "fsm_rules.h"
    62 namespace sc_core {
    63 casc_fsm_step_t casc_fsm_step = ELABORATION;
    64 }
    65 #endif
    6659
    6760namespace sc_core {
     
    259252  cerr << "done.\n";
    260253#endif
    261 #if defined(CONFIG_CHECK_MULTIWRITING2REGISTER)
    262   sc_core::pending_writing2register_clear ();
    263 #endif
    264254}
    265255
     
    354344}
    355345
    356 #if defined(CONFIG_CHECK_MULTIWRITING2REGISTER)
    357 typedef set<const tab_t*> pending_writing2register_set_t;
    358 pending_writing2register_set_t pending_writing2register_set;
    359 
    360 void
    361 pending_writing2register_clear  ()
    362 {
    363   pending_writing2register_set.clear();
    364 }
    365 
    366 void
    367 pending_writing2register_record_and_check (const tab_t *p)
    368 {
    369   if (pending_writing2register_set.find (p) != pending_writing2register_set.end())
    370   {
    371                 std::cerr << "Error : please check '" << get_name (p) << "'.\n";
    372     std::cerr << "Up to 1 writing per register is allowed during a cycle.\n";
    373     sc_stop ();
    374     exit (31072006); // 6
    375   } else
    376     pending_writing2register_set.insert(p);
    377 }
    378 #endif
    379 
    380346} // end of sc_core namespace
    381347
  • sources/src/sc_port_ext.h

    r35 r47  
    2222#endif
    2323
    24 #include "fsm_rules.h"
    2524#include "internal_ext.h"
    2625#include "port_dependency_ext.h"
     
    5655  ((value_type_&) (*((value_type_*) (pointer_))))
    5756
    58   ///////////////////// DEPRECATED
     57///////////////////// DEPRECATED
    5958// C ANSI-only since it is needed to link with extern "C"
    60 // this declaration is not in casc.h since the CONFIG_CHECK_FSM_RULES macro
    61 // is not defined.
    6259
    6360extern void bind (sc_port_base&,sc_port_base&);
     
    188185     << " on signal " << name () << "\n";
    189186#endif
    190 #ifdef CONFIG_CHECK_FSM_RULES
    191   if (casc_fsm_step == GEN_MOORE) {
    192     std::cerr << "FSM rules error : trying to read on input port '"
    193               << name ()
    194         << "' from " <<  get_step_name () << " function.\n";
    195     exit (-1);
    196   }   
    197 #endif
    198187  return READ_SIGNAL(const T, get_pointer());
    199188}
     
    298287     << " on signal " << name () << "\n";
    299288#endif
    300 #ifdef CONFIG_CHECK_FSM_RULES
    301   if (casc_fsm_step == GEN_MOORE) {
    302     std::cerr << "FSM rules error : trying to read on input/output port "
    303       << name () //get_name (get_pointer())
    304       << " from " << get_step_name () << " function.\n";
    305     exit (-1);
    306   }   
    307 #endif
    308289//  return val;
    309290  return READ_SIGNAL(const T, get_pointer());
     
    320301            << " on in/out port (writing into a signal) '" << name () << "'\n";
    321302#endif
    322 #ifdef CONFIG_CHECK_FSM_RULES
    323   if ((casc_fsm_step != GEN_MOORE) && ( casc_fsm_step != GEN_MEALY)) {
    324     std::cerr << "FSM rules error : trying to write on output port "
    325       << name ()
    326       << " from an " << get_step_name () << " function.\n";
    327     exit (-1);
    328   }   
    329 #endif
    330303//  T& ref = *(T*)(get_pointer());
    331 #if defined(CONFIG_CHECK_MULTIWRITING2PORT)
    332   check_multiwriting2port ();
    333 #endif
    334304#ifndef USE_PORT_DEPENDENCY
    335305  unstable |= (value_) != val; //ref;
  • sources/src/sc_signal.h

    r32 r47  
    2626#include "internal_ext.h"
    2727
    28 #ifdef CONFIG_CHECK_FSM_RULES
    29 #include "fsm_rules.h"
    30 #endif
    31 
    3228namespace sc_core {
    3329
     
    4541        ///////////////////// DEPRECATED
    4642// C ANSI-only since it is needed to link with extern "C"
    47 // this declaration is not in casc.h since the CONFIG_CHECK_FSM_RULES macro
    48 // is not defined.
    4943
    5044extern void bind (sc_port_base&,sc_port_base&);
     
    250244                << " on signal " << name () << "\n";
    251245#endif
    252 #ifdef CONFIG_CHECK_FSM_RULES
    253         // we can read value from sc_signal type (used like a register) at any time
    254 #endif 
    255246    return READ_SIGNAL(const T, get_pointer());
    256247}
     
    262253sc_signal<T>::write( const data_type& value_ )
    263254{
    264 #ifdef CONFIG_CHECK_FSM_RULES
    265         if ((casc_fsm_step != TRANSITION)
    266                         && ( casc_fsm_step != STIMULI)) {
    267                 std::cerr << "FSM rules error : trying to write on signal "
    268                           << name ()
    269                           << " from " << get_step_name () << " function.\n";
    270                 exit (-1);
    271         }               
    272 #endif
    273255#ifdef CONFIG_DEBUG
    274256  if (get_pointer() == NULL)
     
    278260  }
    279261#endif
    280 #ifdef CONFIG_CHECK_MULTIWRITING2REGISTER
    281   pending_writing2register_record_and_check (get_pointer ());
    282 #endif
    283262#ifdef DUMP_WRITE
    284263  if (sc_signal<T>::read() == value_)
  • sources/test_regression/Makefile

    r35 r47  
    2828# 19122005  : check simulator state saving for Socview compatibility
    2929# 17022006  : check rename function for Socview compatibility
    30 # 05042006  : check number of writings into each out port
    31 #             check reading from an sc_out port
    32 #             (test check_multiwriting2port option)
    3330# 02052006  : check sc_uint, sc_int, sc_signal<X> when X is double, char,
    3431#             signed int, unsigned int and so on. (little/big endianness test)
    35 # 19072006  : SystemCASS allow 1 writing into each port for each delta cycle.
    36 #             This testbench checks CHECK_MULTIWRITING2PORT macro.
    37 # 31072006  : SystemCASS allow 1 writing into each register for each cycle.
    38 #             This testbench checks CHECK_MULTIWRITING2REGISTER macro.
    3932# 07122006  : check if we can declare an undefined external function as
    4033#             a sc_method.
     
    7871      16112005 \
    7972      16122005 \
    80       05042006 \
    8173      02052006 \
    82       19072006 \
    83       31072006 \
    8474      07122006 \
    8575      20122006 \
Note: See TracChangeset for help on using the changeset viewer.