Ignore:
Timestamp:
Dec 15, 2008, 12:04:03 PM (16 years ago)
Author:
rosiere
Message:

Update document on Vhdl generation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_std_logic.cpp

    r81 r94  
    6161#undef  FUNCTION
    6262#define FUNCTION "Vhdl::std_logic_range"
    63   std::string std_logic_range (uint32_t size, uint32_t max, uint32_t min)
     63  std::string std_logic_range (uint32_t size, uint32_t max, uint32_t min, bool force)
    6464  {
    6565    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    6666    std::string type;
    6767
    68     if (size < 2)
    69       type = "";
     68    if (force)
     69      {
     70        type = "("+toString(max)+" downto "+toString(min)+")";
     71      }
    7072    else
    71       if (max == min)
    72         type = "("+toString(max)+")";
    73       else
    74         type = "("+toString(max)+" downto "+toString(min)+")";
     73      {
     74        if (max == min)
     75          {
     76            type = "("+toString(max)+")";
     77          }
     78        else
     79          {
     80            if (size < 2)
     81              type = "";
     82            else
     83              type = "("+toString(max)+" downto "+toString(min)+")";
     84          }
     85      }
    7586
    7687    log_printf(FUNC,Behavioural,FUNCTION,"End");
     
    7990  };
    8091
    81   std::string std_logic_range (uint32_t max, uint32_t min)
     92  std::string std_logic_range (uint32_t max, uint32_t min, bool force)
    8293  {
    8394    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    8495    std::string type;
    8596
    86     if (max == 0)
    87       type = "";
     97    if (force)
     98      {
     99        type = "("+toString(max)+" downto "+toString(min)+")";
     100      }
    88101    else
    89       if (max == min)
    90         type = "("+toString(max)+")";
    91       else
    92         type = "("+toString(max)+" downto "+toString(min)+")";
     102      {
     103        if (max == min)
     104          {
     105            type = "("+toString(max)+")";
     106          }
     107        else
     108          {
     109            if (max == 0)
     110              type = "";
     111            else
     112              type = "("+toString(max)+" downto "+toString(min)+")";
     113          }
     114      }
    93115
    94116    log_printf(FUNC,Behavioural,FUNCTION,"End");
     
    97119  };
    98120
    99   std::string std_logic_range (uint32_t size)
     121  std::string std_logic_range (uint32_t size, bool force)
    100122  {
    101123    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    102     std::string _return = std_logic_range(size-1,0);
     124    std::string _return = std_logic_range(size-1,0,force);
    103125    log_printf(FUNC,Behavioural,FUNCTION,"End");
    104126
     
    108130#undef  FUNCTION
    109131#define FUNCTION "Vhdl::std_logic_others"
    110   std::string std_logic_others (uint32_t size, uint32_t cst  )
     132  std::string std_logic_others (uint32_t size, bool cst  )
    111133  {
    112134    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
     
    124146  }
    125147
    126 
    127 
    128148}; // end namespace behavioural         
    129149}; // end namespace morpheo             
Note: See TracChangeset for help on using the changeset viewer.