OpenCores
URL https://opencores.org/ocsvn/bluespec-h264/bluespec-h264/trunk

Subversion Repositories bluespec-h264

[/] [bluespec-h264/] [trunk/] [src_fpga/] [mkTH.bsv] - Blame information for rev 100

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 83 jamey.hick
 
2
// The MIT License
3
 
4
// Copyright (c) 2006-2007 Massachusetts Institute of Technology
5
 
6
// Permission is hereby granted, free of charge, to any person obtaining a copy
7
// of this software and associated documentation files (the "Software"), to deal
8
// in the Software without restriction, including without limitation the rights
9
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
// copies of the Software, and to permit persons to whom the Software is
11
// furnished to do so, subject to the following conditions:
12
 
13
// The above copyright notice and this permission notice shall be included in
14
// all copies or substantial portions of the Software.
15
 
16
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
// THE SOFTWARE.
23
 
24 3 jamey.hick
//**********************************************************************
25
// H264 Test Bench
26
//----------------------------------------------------------------------
27
//
28
//
29
 
30
package mkTH;
31
 
32
import H264Types::*;
33
import IMemED::*;
34
import IFrameBuffer::*;
35
import IInputGen::*;
36
import IH264::*;
37
import IVgaController::*;
38
import IFPGAInterface::*;
39
import IEDKBRAM::*;
40
import mkMemED::*;
41
import mkFrameBuffer::*;
42
import mkInputGen::*;
43
import mkH264::*;
44
import mkVgaController::*;
45
import BRAM::*;
46
import mkRoundRobinMemScheduler::*;
47
import mkSRAMMemController::*;
48
import IMemClient::*;
49
import IMemController::*;
50
import IMemScheduler::*;
51
import ISRAMWires::*;
52
import Connectable::*;
53
import GetPut::*;
54
import ClientServer::*;
55
 
56
(* synthesize *)
57
module mkth( IFPGAInterface );
58
 
59
   // Instantiate the modules
60
 
61
   IInputGen     inputgen    <- mkInputGen();
62
   IH264         h264        <- mkH264();
63
   IMemED#(TAdd#(PicWidthSz,1),20) memED          <- mkMemED();
64
   IMemED#(TAdd#(PicWidthSz,2),68) memP_intra     <- mkMemED();
65
   IMemED#(TAdd#(PicWidthSz,2),32) memP_inter     <- mkMemED();
66
   IMemED#(TAdd#(PicWidthSz,5),32) memD_data      <- mkMemED();
67
   IMemED#(PicWidthSz,13)          memD_parameter <- mkMemED();
68
   IFrameBuffer   framebuffer   <- mkFrameBuffer();
69
 
70
   // Cycle counter
71
   Reg#(Bit#(32)) cyclecount <- mkReg(0);
72
 
73
   rule countCycles ( True );
74
      if(cyclecount[4:0]==0) $display( "CCLCycleCount %0d", cyclecount );
75
      cyclecount <= cyclecount+1;
76
      if(cyclecount > 60000000)
77
         begin
78
            $display( "ERROR mkTH: time out" );
79
            $finish(0);
80
         end
81
   endrule
82
 
83
   // Internal connections
84
 
85
   mkConnection( inputgen.ioout, h264.ioin );
86
   mkConnection( h264.mem_clientED, memED.mem_server );
87
   mkConnection( h264.mem_clientP_intra, memP_intra.mem_server );
88
   mkConnection( h264.mem_clientP_inter, memP_inter.mem_server );
89
   mkConnection( h264.mem_clientD_data, memD_data.mem_server );
90
   mkConnection( h264.mem_clientD_parameter, memD_parameter.mem_server );
91
   mkConnection( h264.buffer_client_load, framebuffer.server_load );
92
   mkConnection( h264.buffer_client_store, framebuffer.server_store );
93
 
94
  interface IEDKBRAM bram_controller = inputgen.bram_interface;
95
  interface IVgaController vga_controller = h264.vga_controller;
96
  interface ISRAMWires  sram_controller = h264.sram_controller;
97
  interface ISRAMWires  sram_controller2 = framebuffer.sram_controller;
98
 
99
endmodule
100
 
101
endpackage

powered by: WebSVN 2.1.0

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