blob: 873bbce202fbcb0fbb149c748ac06bc8edb0beb7 [file] [log] [blame]
agorararmard6c766a82020-12-10 18:13:12 +02001// SPDX-FileCopyrightText: 2020 Efabless Corporation
agorararmarde5780bf2020-12-09 21:27:56 +00002//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
agorararmardafa96ea2020-12-09 23:37:31 +020014// SPDX-License-Identifier: Apache-2.0
agorararmarde5780bf2020-12-09 21:27:56 +000015
Matt Venn08cd6eb2020-11-16 12:01:14 +010016`default_nettype none
Tim Edwards04ba17f2020-10-02 22:27:50 -040017// This module represents an unprogrammed mask revision
18// block that is configured with via programming on the
19// chip top level. This value is passed to the block as
20// a parameter
21
22module user_id_programming #(
23 parameter [ 0:0] USER_PROJECT_ID = 32'h0
24) (
Ahmed Ghazy27200e92020-11-25 22:07:02 +020025`ifdef USE_POWER_PINS
manarabdelatyc7524312020-12-07 18:13:54 +020026 inout VPWR,
27 inout VGND,
Ahmed Ghazy27200e92020-11-25 22:07:02 +020028`endif
Tim Edwards04ba17f2020-10-02 22:27:50 -040029 output [31:0] mask_rev
30);
31 wire [31:0] mask_rev;
32 wire [31:0] user_proj_id_high;
33 wire [31:0] user_proj_id_low;
34
35 // For the mask revision input, use an array of digital constant logic cells
36
37 sky130_fd_sc_hd__conb_1 mask_rev_value [31:0] (
Ahmed Ghazy64c17e82020-11-18 20:17:26 +020038`ifdef USE_POWER_PINS
manarabdelatyc7524312020-12-07 18:13:54 +020039 .VPWR(VPWR),
40 .VPB(VPWR),
41 .VNB(VGND),
42 .VGND(VGND),
Ahmed Ghazy64c17e82020-11-18 20:17:26 +020043`endif
Tim Edwards04ba17f2020-10-02 22:27:50 -040044 .HI(user_proj_id_high),
45 .LO(user_proj_id_low)
46 );
47
48 genvar i;
49 generate
50 for (i = 0; i < 32; i = i+1) begin
51 assign mask_rev[i] = (USER_PROJECT_ID & (32'h01 << i)) ?
52 user_proj_id_high[i] : user_proj_id_low[i];
53 end
54 endgenerate
55
56endmodule
Tim Edwards581068f2020-11-19 12:45:25 -050057`default_nettype wire