1 |
10 |
maheshpalv |
////////////////////////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
//// ////
|
3 |
|
|
//// ////
|
4 |
|
|
//// This file is part of the project ////
|
5 |
|
|
//// "instruction_list_pipelined_processor_with_peripherals" ////
|
6 |
|
|
//// ////
|
7 |
|
|
//// http://opencores.org/project,instruction_list_pipelined_processor_with_peripherals ////
|
8 |
|
|
//// ////
|
9 |
|
|
//// ////
|
10 |
|
|
//// Author: ////
|
11 |
|
|
//// - Mahesh Sukhdeo Palve ////
|
12 |
|
|
//// ////
|
13 |
|
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
14 |
|
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
15 |
|
|
//// ////
|
16 |
|
|
//// ////
|
17 |
|
|
//// ////
|
18 |
|
|
//// This source file may be used and distributed without ////
|
19 |
|
|
//// restriction provided that this copyright statement is not ////
|
20 |
|
|
//// removed from the file and that any derivative work contains ////
|
21 |
|
|
//// the original copyright notice and the associated disclaimer. ////
|
22 |
|
|
//// ////
|
23 |
|
|
//// This source file is free software; you can redistribute it ////
|
24 |
|
|
//// and/or modify it under the terms of the GNU Lesser General ////
|
25 |
|
|
//// Public License as published by the Free Software Foundation; ////
|
26 |
|
|
//// either version 2.1 of the License, or (at your option) any ////
|
27 |
|
|
//// later version. ////
|
28 |
|
|
//// ////
|
29 |
|
|
//// This source is distributed in the hope that it will be ////
|
30 |
|
|
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
|
31 |
|
|
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
|
32 |
|
|
//// PURPOSE. See the GNU Lesser General Public License for more ////
|
33 |
|
|
//// details. ////
|
34 |
|
|
//// ////
|
35 |
|
|
//// You should have received a copy of the GNU Lesser General ////
|
36 |
|
|
//// Public License along with this source; if not, download it ////
|
37 |
|
|
//// from http://www.opencores.org/lgpl.shtml ////
|
38 |
|
|
//// ////
|
39 |
|
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
40 |
3 |
maheshpalv |
|
41 |
|
|
`include "timescale.v"
|
42 |
|
|
`include "defines.v"
|
43 |
|
|
|
44 |
|
|
|
45 |
|
|
module tcEnableAndType (entypeEn, enIn, typeIn, tcAddr, enOut, typeOut);
|
46 |
|
|
|
47 |
|
|
input entypeEn, enIn;
|
48 |
|
|
input [`tcTypeLen-1:0] typeIn; // could be `counterTypeLen
|
49 |
|
|
input [`tcAddrLen-1:0] tcAddr;
|
50 |
|
|
|
51 |
|
|
output wire [`tcNumbers-1:0] enOut;
|
52 |
|
|
output wire [(`tcNumbers*`tcTypeLen)-1:0] typeOut;
|
53 |
|
|
|
54 |
|
|
reg enables [`tcNumbers-1:0];
|
55 |
|
|
reg [`tcTypeLen-1:0] types [`tcNumbers-1:0];
|
56 |
|
|
|
57 |
|
|
always @ *
|
58 |
|
|
begin
|
59 |
|
|
if (entypeEn)
|
60 |
|
|
begin
|
61 |
|
|
enables[tcAddr] = enIn;
|
62 |
|
|
types[tcAddr] = typeIn;
|
63 |
|
|
end
|
64 |
|
|
end
|
65 |
|
|
|
66 |
|
|
// assign outputs . . .
|
67 |
|
|
// can write generic???
|
68 |
|
|
|
69 |
|
|
assign enOut[0]= enables[0];
|
70 |
|
|
assign enOut[1]= enables[1];
|
71 |
|
|
assign enOut[2]= enables[2];
|
72 |
|
|
assign enOut[3]= enables[3];
|
73 |
|
|
assign enOut[4]= enables[4];
|
74 |
|
|
assign enOut[5]= enables[5];
|
75 |
|
|
assign enOut[6]= enables[6];
|
76 |
|
|
assign enOut[7]= enables[7];
|
77 |
|
|
|
78 |
|
|
assign typeOut[`tcTypeLen-1:0] = types[0];
|
79 |
|
|
assign typeOut[(`tcTypeLen*2)-1:`tcTypeLen] = types[1];
|
80 |
|
|
assign typeOut[(`tcTypeLen*3)-1:(`tcTypeLen*2)] = types[2];
|
81 |
|
|
assign typeOut[(`tcTypeLen*4)-1:(`tcTypeLen*3)] = types[3];
|
82 |
|
|
assign typeOut[(`tcTypeLen*5)-1:(`tcTypeLen*4)] = types[4];
|
83 |
|
|
assign typeOut[(`tcTypeLen*6)-1:(`tcTypeLen*5)] = types[5];
|
84 |
|
|
assign typeOut[(`tcTypeLen*7)-1:(`tcTypeLen*6)] = types[6];
|
85 |
|
|
assign typeOut[(`tcTypeLen*8)-1:(`tcTypeLen*7)] = types[7];
|
86 |
|
|
|
87 |
|
|
|
88 |
|
|
endmodule
|