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

Update document on Vhdl generation.

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/src
Files:
2 added
23 edited

Legend:

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

    r81 r94  
    77
    88#include "Behavioural/include/Component.h"
     9#include "Common/include/Tabulation.h"
    910
    1011namespace morpheo              {
     
    2526    bool                   empty = _list_component->empty();
    2627
    27     std::string                 tab   = std::string(depth,'\t');
     28    std::string                 tab=morpheo::tab(depth);
     29
    2830    std::ostringstream          text;
    2931
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_test_map.cpp

    r88 r94  
    22 * $Id$
    33 *
    4  * [ Description ]
     4 * [ Description ]
    55 *
    66 */
    77
    88#include "Behavioural/include/Component.h"
     9#include "Common/include/Tabulation.h"
    910
    1011namespace morpheo              {
     
    2324    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    2425
    25     std::string tab  = std::string(depth,' ');
     26    std::string tab  = morpheo::tab(depth);
    2627    std::string name = _entity->get_name();
    2728    bool test_ok = true;
     
    8081//     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    8182
    82 //     std::string tab  = std::string(depth,'\t');
     83//     std::string tab  = tab(depth);
    8384//     std::string name = _entity->get_name();
    8485//     bool test_ok = true;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Entity_test_map.cpp

    r88 r94  
    77
    88#include "Behavioural/include/Entity.h"
     9#include "Common/include/Tabulation.h"
    910#include <iostream>
    1011
     
    1819    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    1920 
    20     std::string tab  = std::string(depth,' ');
     21    std::string tab=morpheo::tab(depth);
     22
    2123    log_printf(INFO,Interface,FUNCTION,"%s* Entity \"%s\"",tab.c_str(),_name.c_str());
    2224 
     
    4143//     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    4244 
    43 //     std::string tab  = std::string(depth,'\t');
     45//     std::string tab  = tab(depth);
    4446//     log_printf(INFO,Behavioural,FUNCTION, "%s* Entity \"%s\"",tab.c_str(),_name.c_str());
    4547 
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo_testbench_assert.cpp

    r88 r94  
    3939              ++i;
    4040            }
    41          
    42           vhdl->set_body("");
    4341        }
    4442   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_get_signal.cpp

    r81 r94  
    77
    88#include "Behavioural/include/Interface.h"
    9 
     9#include "Common/include/Tabulation.h"
    1010
    1111namespace morpheo              {
     
    2424    bool                         empty = _list_signal->empty();
    2525
    26     std::string                 tab   = std::string(depth,'\t');
     26    std::string                 tab   = morpheo::tab(depth);
    2727    std::ostringstream          text;
    2828
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_test_map.cpp

    r88 r94  
    77
    88#include "Behavioural/include/Interface.h"
    9 
     9#include "Common/include/Tabulation.h"
    1010
    1111namespace morpheo              {
     
    1818    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    1919
    20     std::string tab  = std::string(depth,' ');
     20    std::string tab  = morpheo::tab(depth);
    2121    bool _return = true;
    2222
     
    3939//     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    4040
    41 //     std::string tab  = std::string(depth,'\t');
     41//     std::string tab  = tab(depth);
    4242//     bool _return = true;
    4343
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_get_interface.cpp

    r81 r94  
    77
    88#include "Behavioural/include/Interfaces.h"
    9 
     9#include "Common/include/Tabulation.h"
    1010
    1111namespace morpheo              {
     
    2525    bool                   empty = _list_interface->empty();
    2626
    27     std::string                 tab   = std::string(depth,'\t');
     27    std::string                 tab   = morpheo::tab(depth);
    2828    std::ostringstream          text;
    2929
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_test_map.cpp

    r88 r94  
    77
    88#include "Behavioural/include/Interfaces.h"
    9 
     9#include "Common/include/Tabulation.h"
    1010
    1111namespace morpheo              {
     
    1818    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    1919
    20     std::string tab  = std::string(depth,' ');
     20    std::string tab  = morpheo::tab(depth);
    2121
    2222    bool _return = true;
     
    4040//     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    4141
    42 //     std::string tab  = std::string(depth,'\t');
     42//     std::string tab  = tab(depth);
    4343
    4444//     bool _return = true;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_testbench_generate_file.cpp

    r88 r94  
    9999        (*it)->testbench_assert (vhdl_assert,counter);
    100100
    101         vhdl->set_body(vhdl_assert);
     101        vhdl->set_body(3,vhdl_assert);
    102102       
    103103        delete vhdl_assert;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_test_map.cpp

    r88 r94  
    77
    88#include "Behavioural/include/Signal.h"
    9 
     9#include "Common/include/Tabulation.h"
    1010
    1111namespace morpheo              {
     
    1919
    2020    std::string str     = "";
    21     std::string tab     = std::string(depth,' ');
     21    std::string tab     = morpheo::tab(depth);
    2222    bool        _return = true;
    2323
     
    166166
    167167//     std::string str = "";
    168 //     std::string tab = std::string(depth,'\t');
     168//     std::string tab = tab(depth);
    169169//     bool _return = true;
    170170
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree_valid.cpp

    r88 r94  
    2929  }
    3030
    31   void Stat_binary_tree::print (uint32_t depth)
    32   {
    33     std::string tab = std::string(depth,'\t');
    34     std::string sep = " ";
    35     if (_data_type == NONE)
    36       {
    37         std::cout << tab << "<node> NONE (error)" << std::endl;
    38 
    39         if (_left  != NULL)
    40           _left ->print(depth+1);
    41         if (_right != NULL)
    42           _right->print(depth+1);
    43       }
    44 
    45     if ((_data_type == VARIABLE) or
    46         (_data_type == CONSTANT))
    47       {
    48         std::cout << tab << "<leaf>"
    49                   << " "
    50                   << ((_left   == NULL)?"left  == NULL        ":"left  != NULL (error)")
    51                   << " "
    52                   << ((_right  == NULL)?"right == NULL        ":"right != NULL (error)")
    53                   << std::endl;
    54 
    55         if (_left  != NULL)
    56           _left ->print(depth+1);
    57         if (_right != NULL)
    58           _right->print(depth+1);
    59       }
    60    
    61     if (_data_type == OPERATOR_UNARY)
    62       {
    63         std::cout << tab << "<unary>"
    64                   << " "
    65                   << ((_left   == NULL)?"left  == NULL (error)":"left  != NULL        ")
    66                   << " "
    67                   << ((_right  == NULL)?"right == NULL        ":"right != NULL (error)")
    68                   << std::endl;
    69        
    70         if (_left  != NULL)
    71           _left ->print(depth+1);
    72         if (_right != NULL)
    73           _right->print(depth+1);
    74       }
    75 
    76     if (_data_type == OPERATOR_BINARY)
    77       {
    78         std::cout << tab << "<binary>"
    79                   << " "
    80                   << ((_left   == NULL)?"left  == NULL (error)":"left  != NULL        ")
    81                   << " "
    82                   << ((_right  == NULL)?"right == NULL (error)":"right != NULL        ")
    83                   << std::endl;
    84 
    85         if (_left  != NULL)
    86           _left ->print(depth+1);
    87         if (_right != NULL)
    88           _right->print(depth+1);
    89       }
    90   }
    91 
    9231};
    9332};
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_architecture.cpp

    r81 r94  
    44 * $Id$
    55 *
    6  * [ Description ]
     6 * [ Description ]
    77 *
    88 */
    99
    1010#include "Behavioural/include/Vhdl.h"
     11#include "Common/include/Tabulation.h"
    1112
    1213#include <sstream>
     
    2324    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    2425
    25     std::string        tab = std::string(depth,'\t');
     26    std::string        tab = morpheo::tab(depth);
    2627    std::ostringstream text;
    2728
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_component.cpp

    r81 r94  
    99
    1010#include "Behavioural/include/Vhdl.h"
     11#include "Common/include/Tabulation.h"
    1112
    1213#include <sstream>
     
    2223    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    2324
    24     std::string        tab = std::string(depth,'\t');
     25    std::string        tab = morpheo::tab(depth);
    2526    std::ostringstream text;
    2627
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_entity.cpp

    r81 r94  
    99
    1010#include "Behavioural/include/Vhdl.h"
     11#include "Common/include/Tabulation.h"
    1112
    1213#include <sstream>
     
    2223    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    2324
    24     std::string        tab = std::string(depth,'\t');
     25    std::string        tab = morpheo::tab(depth);
    2526    std::ostringstream text;
    2627
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_header.cpp

    r88 r94  
    2323    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    2424
    25     std::string tab = std::string(depth,'\t');
    2625    std::string text;
    2726
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_library_ieee.cpp

    r81 r94  
    99
    1010#include "Behavioural/include/Vhdl.h"
     11#include "Common/include/Tabulation.h"
    1112
    1213#include <sstream>
     
    2122    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    2223
    23     std::string        tab = std::string(depth,'\t');
     24    std::string        tab = morpheo::tab(depth);
    2425    std::ostringstream text;
    2526
    26     text << tab                                       << std::endl
    27          << tab << "library ieee;"                    << std::endl
    28          << tab << "use ieee.numeric_bit.all;"        << std::endl
    29          << tab << "use ieee.numeric_std.all;"        << std::endl
    30          << tab << "use ieee.std_logic_1164.all;"    << std::endl
    31          << tab << "use ieee.std_logic_arith.all;"    << std::endl
    32          << tab << "use ieee.std_logic_misc.all;"    << std::endl
    33          << tab << "--use ieee.std_logic_signed.all;" << std::endl
    34          << tab << "use ieee.std_logic_unsigned.all;" << std::endl
    35          << tab << "--use ieee.std_logic_textio.all;" << std::endl;
     27    text << tab                                         << std::endl
     28         << tab << "library ieee;"                      << std::endl
     29         << tab << "  use ieee.numeric_bit.all;       " << std::endl
     30         << tab << "  use ieee.numeric_std.all;       " << std::endl
     31         << tab << "  use ieee.std_logic_1164.all;    " << std::endl
     32         << tab << "  use ieee.std_logic_arith.all;   " << std::endl
     33         << tab << "  use ieee.std_logic_misc.all;    " << std::endl
     34         << tab << "--use ieee.std_logic_signed.all;  " << std::endl
     35         << tab << "  use ieee.std_logic_unsigned.all;" << std::endl
     36         << tab << "--use ieee.std_logic_textio.all;  " << std::endl;
    3637     
    3738    log_printf(FUNC,Behavioural,FUNCTION,"End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_library_work.cpp

    r81 r94  
    99
    1010#include "Behavioural/include/Vhdl.h"
    11 
     11#include "Common/include/Tabulation.h"
    1212#include <sstream>
    1313
     
    2222
    2323    std::list<std::string>::iterator i   = _list_library_work.begin();
    24     std::string                 tab = std::string(depth,'\t');
     24    std::string                 tab = morpheo::tab(depth);
    2525    std::ostringstream          text;
    2626
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_model.cpp

    r81 r94  
    99
    1010#include "Behavioural/include/Vhdl.h"
    11 
     11#include "Common/include/Tabulation.h"
    1212#include <sstream>
    1313
     
    2222    log_printf(FUNC,Behavioural,"get_model","Begin");
    2323
    24     std::string        tab = std::string(depth,'\t');
     24    std::string        tab = morpheo::tab(depth);
    2525    std::ostringstream text;
    2626
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_package.cpp

    r81 r94  
    99
    1010#include "Behavioural/include/Vhdl.h"
    11 
     11#include "Common/include/Tabulation.h"
    1212#include <sstream>
    1313
     
    2424    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    2525
    26     std::string        tab = std::string(depth,'\t');
     26    std::string        tab = morpheo::tab(depth);
    2727    std::ostringstream text;
    2828
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_body.cpp

    r88 r94  
    99
    1010#include "Behavioural/include/Vhdl.h"
    11 
     11#include "Common/include/Tabulation.h"
    1212#include <sstream>
    1313
     
    2020  {
    2121    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    22     set_list(_list_body, text);
     22    set_body(0, text);
     23    log_printf(FUNC,Behavioural,FUNCTION,"End");
     24  };
     25
     26#undef  FUNCTION
     27#define FUNCTION "Vhdl::set_body"
     28  void Vhdl::set_body (uint32_t depth,
     29                       std::string text)
     30  {
     31    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
     32    set_list(_list_body, morpheo::tab(depth)+text);
    2333    log_printf(FUNC,Behavioural,FUNCTION,"End");
    2434  };
     
    2636#undef  FUNCTION
    2737#define FUNCTION "Vhdl::set_body"
    28   void Vhdl::set_body (Vhdl * vhdl)
     38  void Vhdl::set_body (uint32_t depth,
     39                       Vhdl * vhdl)
    2940  {
    3041    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    3142   
     43    std::string tab=morpheo::tab(depth);
     44
    3245    for (std::list<std::string>::iterator it=vhdl->_list_body.begin();
    3346         it!=vhdl->_list_body.end();
    3447         ++it)
    35       set_list(_list_body, *it);
     48      set_list(_list_body,tab+*it);
    3649
    3750    log_printf(FUNC,Behavioural,FUNCTION,"End");
  • 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             
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_get_body.cpp

    r88 r94  
    77
    88#include "Behavioural/include/XML.h"
     9#include "Common/include/Tabulation.h"
    910
    1011namespace morpheo              {
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_indent.cpp

    r81 r94  
    77
    88#include "Behavioural/include/XML.h"
     9#include "Common/include/Tabulation.h"
    910
    1011namespace morpheo              {
     
    1617  {
    1718    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    18     std::string _return = std::string(depth,'\t');
     19    std::string _return = tab(depth);
    1920    log_printf(FUNC,Behavioural,FUNCTION,"End");
    2021
Note: See TracChangeset for help on using the changeset viewer.