Changeset 40
- Timestamp:
- Dec 7, 2012, 11:32:04 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
PROJECT_CORE_MPI/SWITCH_GEN/BRANCHES/v0.01/CoreTypes.vhd
r36 r40 148 148 --renvoie un std_logic_vector de taille width 149 149 Function Stdlv (s1 : natural;width:positive ) return std_logic_vector; 150 function image(L: bit_vector) return String; 151 function image(L: bit) return String; 152 function image(L: std_logic_vector) return String; 153 function image(L: std_logic) return String; 154 -- function HexImage(L: unsigned) return String; 155 -- function HexImage(L: signed) return String; 156 -- function HexImage(L: std_ulogic_vector) return String; 157 -- function HexImage(L: std_logic_vector) return String; 158 -- function HexImage(L: bit_vector) return String; 150 159 end CoreTypes; 151 160 … … 238 247 return V; 239 248 end stdlv; 249 250 -- Start of heximage functions 251 --function HexImage(L: bit_vector) return String is 252 --begin 253 --return(HexImage(imge(L))); 254 --end function HexImage; 255 -- 256 --function HexImage(L: std_ulogic_vector) return String is 257 --begin 258 --return(HexImage(image(to_x01(L)))); 259 --end function HexImage; 260 261 --function HexImage(L: std_logic_vector) return String is 262 --begin 263 --return(HexImage(imge(to_x01(L)))); 264 --end function HexImage; 265 -- 266 --function HexImage(L: signed) return String is 267 --begin 268 --return(HexImage(imge(L))); 269 --end function HexImage; 270 -- 271 --function HexImage(L: unsigned) return String is 272 --begin 273 --return(HexImage(image(L))); 274 --end function HexImage; 275 -- End of heximage functions 276 -- Start of an example image function 277 function image(L: bit) return String is 278 constant bit_image: String := bit'image(L); 279 begin 280 return(bit_image(2 to 2)); 281 end function image; 282 283 284 function image(L: std_logic) return String is 285 variable bit_image: String := std_logic'image(L); 286 begin 287 return(bit_image(2 to 2)); 288 end function image; 289 290 function image(L: bit_vector) return String is 291 variable Lx: bit_vector(1 to L'length); 292 variable RetVal: String(1 to L'length); 293 begin 294 Lx := L; 295 for i in Lx'range loop 296 RetVal(i to i) := image(Lx(i)); 297 end loop; 298 return(RetVal); 299 end function image; 300 301 302 function image(L: std_logic_vector) return String is 303 variable Lx: std_logic_vector(1 to L'length); 304 variable RetVal: String(1 to L'length); 305 begin 306 Lx := L; 307 for i in Lx'range loop 308 RetVal(i to i) := image(Lx(i)); 309 end loop; 310 return(RetVal); 311 end function image; 240 312 end CoreTypes;
Note: See TracChangeset
for help on using the changeset viewer.