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

Subversion Repositories bluespec_md6

[/] [bluespec_md6/] [trunk/] [MD6Control/] [test/] [benchmarks/] [MD6ShiftRegister.bsv] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 kfleming
import FIFOF::*;
2
import MD6Parameters::*;
3
import MD6Types::*;
4
import CompressionFunctionTypes::*;
5
import CompressionFunctionParameters::*;
6
import CompressionFunctionLibrary::*;
7
import Debug::*;
8
import SGenerator::*;
9
import Vector::*;
10
 
11
interface MD6ShiftRegister#(numeric type taps);
12
  method Vector#(taps,MD6Word) getT0;
13
  method Vector#(taps,MD6Word) getT1;
14
  method Vector#(taps,MD6Word) getT2;
15
  method Vector#(taps,MD6Word) getT3;
16
  method Vector#(taps,MD6Word) getT4;
17
  method Vector#(taps,MD6Word) getT5;
18
  method Action write(Vector#(taps,MD6Word) nextValues);
19
  method Action advance();
20
//  method Action advanceB();
21
  interface Vector#(MD6_n, Reg#(MD6Word)) regs;
22
endinterface
23
 
24
 
25
module mkMD6ShiftRegister (MD6ShiftRegister#(taps))
26
  provisos(Add#(taps,yyy,MD6_n));
27
  Integer historyLength = valueof(taps);
28
  Vector#(MD6_n,Reg#(MD6Word)) t0 <- replicateM(mkReg(0));
29
  // we pulled out a subtraction of history length
30
  method Vector#(taps,MD6Word) getT0;
31
    return takeAt(determineT0,readVReg(t0));
32
  endmethod
33
 
34
  method Vector#(taps,MD6Word) getT1;
35
    return  takeAt(determineT1,readVReg(t0));
36
  endmethod
37
 
38
  method Vector#(taps,MD6Word) getT2;
39
    return  takeAt(determineT2,readVReg(t0));
40
  endmethod
41
 
42
  method Vector#(taps,MD6Word) getT3;
43
    return  takeAt(determineT3,readVReg(t0));
44
  endmethod
45
 
46
  method Vector#(taps,MD6Word) getT4;
47
    return  takeAt(determineT4,readVReg(t0));
48
  endmethod
49
 
50
  method Vector#(taps,MD6Word) getT5;
51
    return  takeAt(determineT5,readVReg(t0));
52
  endmethod
53
 
54
  method Action  write(Vector#(taps,MD6Word) nextword);
55
    writeVReg(takeAt(valueof(MD6_n)-valueof(taps),t0),nextword);
56
  endmethod
57
 
58
  method Action advance();
59
    for(Integer i = 0; i < valueof(MD6_n); i=i+1)
60
      begin
61
//        $display("Advance ShiftState[%d]: %h",i, t0[i]);
62
      end
63
    for(Integer i = 0; i < valueof(MD6_n)-valueof(taps); i=i+1)
64
      begin
65
        t0[i] <= t0[i+valueof(taps)];
66
      end
67
  endmethod
68
 
69
/* This may no longer be necessary
70
  method Action advanceB();
71
    for(Integer i = valueof(MD6_n) - valueof(MD6_b); i < valueof(MD6_n) - valueof(taps); i=i+1)
72
      begin
73
        //$display("advanceB ShiftState[%d]: %h <= %h",i, t0[i+valueof(taps)],t0[i]);
74
        t0[i+valueof(taps)] <= t0[i];
75
      end
76
  endmethod
77
*/
78
 
79
  interface regs = t0;
80
 
81
endmodule

powered by: WebSVN 2.1.0

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