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

Subversion Repositories mips_enhanced

[/] [mips_enhanced/] [trunk/] [grlib-gpl-1.0.19-b3188/] [lib/] [grlib/] [sparc/] [cpu_disas.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dimamali
------------------------------------------------------------------------------
2
--  This file is a part of the GRLIB VHDL IP LIBRARY
3
--  Copyright (C) 2003, Gaisler Research
4
--
5
--  This program is free software; you can redistribute it and/or modify
6
--  it under the terms of the GNU General Public License as published by
7
--  the Free Software Foundation; either version 2 of the License, or
8
--  (at your option) any later version.
9
--
10
--  This program is distributed in the hope that it will be useful,
11
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
--  GNU General Public License for more details.
14
--
15
--  You should have received a copy of the GNU General Public License
16
--  along with this program; if not, write to the Free Software
17
--  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
18
-----------------------------------------------------------------------------
19
-- Package:     cpu_disas
20
-- File:        cpu_disas.vhd
21
-- Author:      Jiri Gaisler, Gaisler Research
22
-- Description: SPARC disassembler according to SPARC V8 manual 
23
------------------------------------------------------------------------------
24
 
25
-- pragma translate_off
26
 
27
library ieee;
28
use ieee.std_logic_1164.all;
29
library grlib;
30
use grlib.stdlib.all;
31
use grlib.sparc.all;
32
use grlib.sparc_disas.all;
33
 
34
entity cpu_disas is
35
port (
36
  clk   : in std_ulogic;
37
  rstn  : in std_ulogic;
38
  dummy : out std_ulogic;
39
  inst  : in std_logic_vector(31 downto 0);
40
  pc    : in std_logic_vector(31 downto 2);
41
  result: in std_logic_vector(31 downto 0);
42
  index : in std_logic_vector(3 downto 0);
43
  wreg  : in std_ulogic;
44
  annul : in std_ulogic;
45
  holdn : in std_ulogic;
46
  pv    : in std_ulogic;
47
  trap  : in std_ulogic;
48
  disas : in std_ulogic);
49
end;
50
 
51
architecture behav of cpu_disas is
52
begin
53
 
54
  dummy <= '1';
55
 
56
  trc : process(clk)
57
    variable valid : boolean;
58
    variable op : std_logic_vector(1 downto 0);
59
    variable op3 : std_logic_vector(5 downto 0);
60
    variable fpins, fpld : boolean;
61
    variable iindex : integer;
62
  begin
63
      iindex := conv_integer(index);
64
      op := inst(31 downto 30); op3 := inst(24 downto 19);
65
      fpins := (op = FMT3) and ((op3 = FPOP1) or (op3 = FPOP2));
66
      fpld := (op = LDST) and ((op3 = LDF) or (op3 = LDDF) or (op3 = LDFSR));
67
      valid := (((not annul) and pv) = '1') and (not ((fpins or fpld) and (trap = '0')));
68
      valid := valid and (holdn = '1');
69
    if rising_edge(clk) and (rstn = '1') then
70
      print_insn (iindex, pc(31 downto 2) & "00", inst,
71
                  result, valid, trap = '1', wreg = '1', false);
72
    end if;
73
  end process;
74
 
75
end;
76
 
77
 
78
library ieee;
79
use ieee.std_logic_1164.all;
80
library grlib;
81
use grlib.stdlib.all;
82
use grlib.sparc.all;
83
use grlib.sparc_disas.all;
84
 
85
entity fpu_disas is
86
port (
87
  clk   : in std_ulogic;
88
  rstn  : in std_ulogic;
89
  dummy : out std_ulogic;
90
  wr2inst  : in std_logic_vector(31 downto 0);
91
  wr2pc    : in std_logic_vector(31 downto 2);
92
  divinst  : in std_logic_vector(31 downto 0);
93
  divpc    : in std_logic_vector(31 downto 2);
94
  dbg_wrdata: in std_logic_vector(63 downto 0);
95
  index : in std_logic_vector(3 downto 0);
96
  dbg_wren : in std_logic_vector(1 downto 0);
97
  resv  : in std_ulogic;
98
  ld    : in std_ulogic;
99
  rdwr  : in std_ulogic;
100
  ccwr  : in std_ulogic;
101
  rdd   : in std_ulogic;
102
  div_valid  : in std_ulogic;
103
  holdn : in std_ulogic;
104
  disas : in std_ulogic);
105
end;
106
 
107
architecture behav of fpu_disas is
108
begin
109
 
110
  dummy <= '1';
111
 
112
  trc : process(clk)
113
    variable valid : boolean;
114
    variable op : std_logic_vector(1 downto 0);
115
    variable op3 : std_logic_vector(5 downto 0);
116
    variable fpins, fpld : boolean;
117
    variable iindex : integer;
118
  begin
119
    iindex := conv_integer(index);
120
 
121
    if rising_edge(clk) and (rstn = '1') then
122
         valid := ((((rdwr and not ld) or ccwr or (ld and resv)) and holdn) = '1');
123
         print_fpinsn(0, wr2pc(31 downto 2) & "00", wr2inst, dbg_wrdata,
124
                      (rdd = '1'), valid, false, (dbg_wren /= "00"));
125
         print_fpinsn(0, divpc(31 downto 2) & "00", divinst, dbg_wrdata,
126
                      (rdd = '1'), (div_valid and holdn) = '1', false, (dbg_wren /= "00"));
127
    end if;
128
  end process;
129
 
130
end;
131
 
132
 
133
-- pragma translate_on

powered by: WebSVN 2.1.0

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