OSDN Git Service

Merge remote branch 'origin/master'
[oca1/test.git] / VGADisplay / src / vram_ctrl.nsl
1 /**
2 *       VRAM Control Module
3 *       Module name is "vram_ctrl"
4 *       @author zyanham
5 *       @version 1.0
6 *       Comment : Reading Steiner
7 */
8
9 #include "vram.nsh"
10
11 declare vram_ctrl {
12
13         input    i_Wdata[8] ;   // in Write Data
14         input    i_Wadrs[14] ;  // in Write Address
15         input    i_Radrs[14] ;  // in Read Address
16         output   o_Rdata[8] ;   // out Read Data
17
18         func_in  fi_Wr_req( i_Wadrs, i_Wdata ) ;
19         func_in  fi_Rd_req( i_Radrs ) ;
20         func_out fo_Rd_ack( o_Rdata ) ;
21 }
22 module vram_ctrl{
23         vram u_VRAM ;
24         
25         reg r_Radrs_hld[14] = 0 ;
26
27         {
28                 /* Memory Terminal Assign */
29
30                 if(~fi_Wr_req) {
31                         u_VRAM.we       = 0 ;
32                 }
33         }
34         
35         func fi_Wr_req {
36                 u_VRAM.we       = 1 ;
37                 u_VRAM.d        = i_Wdata ;
38                 u_VRAM.wa       = i_Wadrs ;
39         }
40         
41         func fi_Rd_req seq {
42                         u_VRAM.ra = i_Radrs ;
43                 {
44                         u_VRAM.ra = r_Radrs_hld ;
45                         fo_Rd_ack( u_VRAM.q ) ;
46                 }
47         }
48 }