OpenCores
URL https://opencores.org/ocsvn/vhdl_cpu_emulator/vhdl_cpu_emulator/trunk

Subversion Repositories vhdl_cpu_emulator

[/] [vhdl_cpu_emulator/] [trunk/] [package.vhd] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 nachumk
--Mango DSP Ltd. Copyright (C) 2006
2
--Creator: Nachum Kanovsky
3
 
4
library ieee;
5
use ieee.std_logic_1164.all;
6
use std.textio.all;
7
 
8
package design_top_constants is
9
  subtype filename is string(1 to 256);
10
  type    array2xfilename is array (1 downto 0) of filename;
11
 
12
  function mk_filename(inp : string) return filename;
13
end design_top_constants;
14
 
15
package body design_top_constants is
16
  function mk_filename(inp : string) return filename is
17
    variable res        : filename := (others => NUL);
18
    variable inp_length : integer  := 0;
19
  begin
20
    if inp'length > filename'high then
21
      inp_length := filename'high;
22
    else
23
      inp_length := inp'length;
24
    end if;
25
    res(1 to inp_length) := inp(1 to inp_length);
26
    return res;
27
  end;
28
end design_top_constants;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.