- Timestamp:
- Dec 15, 2008, 12:04:03 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_std_logic.cpp
r81 r94 61 61 #undef FUNCTION 62 62 #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) 64 64 { 65 65 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 66 66 std::string type; 67 67 68 if (size < 2) 69 type = ""; 68 if (force) 69 { 70 type = "("+toString(max)+" downto "+toString(min)+")"; 71 } 70 72 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 } 75 86 76 87 log_printf(FUNC,Behavioural,FUNCTION,"End"); … … 79 90 }; 80 91 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) 82 93 { 83 94 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 84 95 std::string type; 85 96 86 if (max == 0) 87 type = ""; 97 if (force) 98 { 99 type = "("+toString(max)+" downto "+toString(min)+")"; 100 } 88 101 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 } 93 115 94 116 log_printf(FUNC,Behavioural,FUNCTION,"End"); … … 97 119 }; 98 120 99 std::string std_logic_range (uint32_t size )121 std::string std_logic_range (uint32_t size, bool force) 100 122 { 101 123 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); 103 125 log_printf(FUNC,Behavioural,FUNCTION,"End"); 104 126 … … 108 130 #undef FUNCTION 109 131 #define FUNCTION "Vhdl::std_logic_others" 110 std::string std_logic_others (uint32_t size, uint32_tcst )132 std::string std_logic_others (uint32_t size, bool cst ) 111 133 { 112 134 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); … … 124 146 } 125 147 126 127 128 148 }; // end namespace behavioural 129 149 }; // end namespace morpheo
Note: See TracChangeset
for help on using the changeset viewer.