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

Subversion Repositories myblaze

[/] [myblaze/] [trunk/] [rtl/] [gprf.py] - Blame information for rev 2

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 rockee
# -*- coding: utf-8 -*-
2
"""
3
    gprf.py
4
    =======
5
 
6
    General purpose Register File
7
 
8
    :copyright: Copyright (c) 2010 Jian Luo.
9
    :author-email: jian <dot> luo <dot> cn <at> gmail <dot> com.
10
    :license: BSD, see LICENSE for details.
11
    :revision: $Id$
12
"""
13
 
14
from myhdl import *
15
from defines import *
16
from functions import *
17
from dsram import *
18
from debug import *
19
 
20
def GPRF(
21
        clock,
22
        enable,
23
        gprf_adr_a_i,
24
        gprf_adr_b_i,
25
        gprf_adr_d_i,
26
        gprf_dat_w_i,
27
        gprf_adr_w_i,
28
        gprf_wre_i,
29
        gprf_dat_a_o,
30
        gprf_dat_b_o,
31
        gprf_dat_d_o,
32
        ):
33
    a = DSRAM(gprf_dat_a_o, gprf_adr_a_i, enable,
34
              gprf_dat_w_i, gprf_adr_w_i, gprf_wre_i, clock,
35
              width=CFG_DMEM_WIDTH, size=CFG_GPRF_SIZE)
36
    b = DSRAM(gprf_dat_b_o, gprf_adr_b_i, enable,
37
              gprf_dat_w_i, gprf_adr_w_i, gprf_wre_i, clock,
38
              width=CFG_DMEM_WIDTH, size=CFG_GPRF_SIZE)
39
    d = DSRAM(gprf_dat_d_o, gprf_adr_d_i, enable,
40
              gprf_dat_w_i, gprf_adr_w_i, gprf_wre_i, clock,
41
              width=CFG_DMEM_WIDTH, size=CFG_GPRF_SIZE)
42
 
43
    #if __debug__:
44
        #@instance
45
        #def show():
46
            #while DEBUG_VERBOSE:
47
                #yield clock.posedge
48
                ##print 'tick'
49
                #addr_a = gprf_adr_a_i
50
                #addr_b = gprf_adr_b_i
51
                #addr_d = gprf_adr_d_i
52
                #if enable and gprf_wre_i:
53
                    #print 'gprf:\twrite:\t',
54
                    #print 'Rd := R%d<-0x%x' % (gprf_adr_w_i, gprf_dat_w_i)
55
                #yield delay(1)
56
                #if enable:
57
                    #print 'gprf:\tread:\t',
58
                    #print ('Ra := R%d->0x%x, Rb := R%d->0x%x, Rd := R%d->0x%x'
59
                           #% (addr_a, gprf_dat_a_o,
60
                              #addr_b, gprf_dat_b_o,
61
                              #addr_d, gprf_dat_d_o))
62
 
63
 
64
    return instances()
65
 
66
### EOF ###
67
# vim:smarttab:sts=4:ts=4:sw=4:et:ai:tw=80:
68
 

powered by: WebSVN 2.1.0

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