joe 发表于 2021-9-3 10:56:09

读取文件内容生成组合逻辑

在chisel中,我们可以通过Vec创建逻辑表从而很容易生成逻辑。有时候数据在文件中,我们通过读其中的
数据从而产生逻辑表。逻辑表的数据可以用VecInit来存储,比如:
val logictable = VecInit(array.map(_.U(8.W)))
下面举例,读取一个文本文件内容生成逻辑表,代码如下:
import chisel3._
import scala.io.Source
class FileReader extends Module {
        val io = IO(new Bundle {
                val address = Input(UInt(8.W))
                val data = Output(UInt(8.W))
        })
        val array = new Array(256)
        var idx = 0;
        //读文件内容并存入ARRAY
        val source = Source.fromFile("h:/data.txt") //一个数据占一行 ,分别是1   2   3 ....
        for(line <- source.getLines()) {
                array(idx) = line.toInt
                idx += 1
        }
        //将ARRAY中数据转换成chisel的Vec类型
        //每个数据加1
        val table = VecInit(array.map(d => (d+1).U(8.W)))   //VecInit的apply中需要Seq T是硬件类型
        //从address所选的地址单元输出
       //VecInit需要Seq,而且T是硬件类型,array则是一个数据区块空间, 可以用Aggregate.scala中的class Vec的def apply(p:UInt):T获取区块中某个地址索引的值
        io.data := table(io.address)
}
测试:
import chisel3._
import chisel3.iotesters._
class SourceFileReaderModuleTester(m:SourceFileReaderModule) extends PeekPokeTester (m){
poke(m.io.addr,2)//所以:正确值应该是4而不是2或3
expect(m.io.data,2) // EXPECT AT 0   io_data got 4 expected 2 FAIL
expect(m.io.data,3) // EXPECT AT 0   io_data got 4 expected 3 FAIL
expect(m.io.data,4)
}
object SourceFileReaderModuleTester {
def main(args: Array): Unit = {
    iotesters.Driver(()=>new SourceFileReaderModule)(t=>new SourceFileReaderModuleTester(t))
}
}

joe 发表于 2021-9-3 10:56:48

最终产生的verilog代码如下:
module SourceFileReaderModule(
input      clock,
input      reset,
input io_addr,
output io_data
);
wire _GEN_1 = 8'h1 == io_addr ? 8'h3 : 8'h2; // @
wire _GEN_2 = 8'h2 == io_addr ? 8'h4 : _GEN_1; // @
wire _GEN_3 = 8'h3 == io_addr ? 8'h5 : _GEN_2; // @
wire _GEN_4 = 8'h4 == io_addr ? 8'h6 : _GEN_3; // @
wire _GEN_5 = 8'h5 == io_addr ? 8'h7 : _GEN_4; // @
wire _GEN_6 = 8'h6 == io_addr ? 8'h8 : _GEN_5; // @
wire _GEN_7 = 8'h7 == io_addr ? 8'h9 : _GEN_6; // @
wire _GEN_8 = 8'h8 == io_addr ? 8'ha : _GEN_7; // @
wire _GEN_9 = 8'h9 == io_addr ? 8'hb : _GEN_8; // @
wire _GEN_10 = 8'ha == io_addr ? 8'hc : _GEN_9; // @
wire _GEN_11 = 8'hb == io_addr ? 8'hd : _GEN_10; // @
wire _GEN_12 = 8'hc == io_addr ? 8'he : _GEN_11; // @
wire _GEN_13 = 8'hd == io_addr ? 8'hf : _GEN_12; // @
wire _GEN_14 = 8'he == io_addr ? 8'h10 : _GEN_13; // @
wire _GEN_15 = 8'hf == io_addr ? 8'h11 : _GEN_14; // @
wire _GEN_16 = 8'h10 == io_addr ? 8'h12 : _GEN_15; // @
wire _GEN_17 = 8'h11 == io_addr ? 8'h13 : _GEN_16; // @
wire _GEN_18 = 8'h12 == io_addr ? 8'h14 : _GEN_17; // @
wire _GEN_19 = 8'h13 == io_addr ? 8'h15 : _GEN_18; // @
wire _GEN_20 = 8'h14 == io_addr ? 8'h1 : _GEN_19; // @
wire _GEN_21 = 8'h15 == io_addr ? 8'h1 : _GEN_20; // @
wire _GEN_22 = 8'h16 == io_addr ? 8'h1 : _GEN_21; // @
wire _GEN_23 = 8'h17 == io_addr ? 8'h1 : _GEN_22; // @
wire _GEN_24 = 8'h18 == io_addr ? 8'h1 : _GEN_23; // @
wire _GEN_25 = 8'h19 == io_addr ? 8'h1 : _GEN_24; // @
wire _GEN_26 = 8'h1a == io_addr ? 8'h1 : _GEN_25; // @
wire _GEN_27 = 8'h1b == io_addr ? 8'h1 : _GEN_26; // @
wire _GEN_28 = 8'h1c == io_addr ? 8'h1 : _GEN_27; // @
wire _GEN_29 = 8'h1d == io_addr ? 8'h1 : _GEN_28; // @
wire _GEN_30 = 8'h1e == io_addr ? 8'h1 : _GEN_29; // @
wire _GEN_31 = 8'h1f == io_addr ? 8'h1 : _GEN_30; // @
wire _GEN_32 = 8'h20 == io_addr ? 8'h1 : _GEN_31; // @
wire _GEN_33 = 8'h21 == io_addr ? 8'h1 : _GEN_32; // @
wire _GEN_34 = 8'h22 == io_addr ? 8'h1 : _GEN_33; // @
wire _GEN_35 = 8'h23 == io_addr ? 8'h1 : _GEN_34; // @
wire _GEN_36 = 8'h24 == io_addr ? 8'h1 : _GEN_35; // @
wire _GEN_37 = 8'h25 == io_addr ? 8'h1 : _GEN_36; // @
wire _GEN_38 = 8'h26 == io_addr ? 8'h1 : _GEN_37; // @
wire _GEN_39 = 8'h27 == io_addr ? 8'h1 : _GEN_38; // @
wire _GEN_40 = 8'h28 == io_addr ? 8'h1 : _GEN_39; // @
wire _GEN_41 = 8'h29 == io_addr ? 8'h1 : _GEN_40; // @
wire _GEN_42 = 8'h2a == io_addr ? 8'h1 : _GEN_41; // @
wire _GEN_43 = 8'h2b == io_addr ? 8'h1 : _GEN_42; // @
wire _GEN_44 = 8'h2c == io_addr ? 8'h1 : _GEN_43; // @
wire _GEN_45 = 8'h2d == io_addr ? 8'h1 : _GEN_44; // @
wire _GEN_46 = 8'h2e == io_addr ? 8'h1 : _GEN_45; // @
wire _GEN_47 = 8'h2f == io_addr ? 8'h1 : _GEN_46; // @
wire _GEN_48 = 8'h30 == io_addr ? 8'h1 : _GEN_47; // @
wire _GEN_49 = 8'h31 == io_addr ? 8'h1 : _GEN_48; // @
wire _GEN_50 = 8'h32 == io_addr ? 8'h1 : _GEN_49; // @
wire _GEN_51 = 8'h33 == io_addr ? 8'h1 : _GEN_50; // @
wire _GEN_52 = 8'h34 == io_addr ? 8'h1 : _GEN_51; // @
wire _GEN_53 = 8'h35 == io_addr ? 8'h1 : _GEN_52; // @
wire _GEN_54 = 8'h36 == io_addr ? 8'h1 : _GEN_53; // @
wire _GEN_55 = 8'h37 == io_addr ? 8'h1 : _GEN_54; // @
wire _GEN_56 = 8'h38 == io_addr ? 8'h1 : _GEN_55; // @
wire _GEN_57 = 8'h39 == io_addr ? 8'h1 : _GEN_56; // @
wire _GEN_58 = 8'h3a == io_addr ? 8'h1 : _GEN_57; // @
wire _GEN_59 = 8'h3b == io_addr ? 8'h1 : _GEN_58; // @
wire _GEN_60 = 8'h3c == io_addr ? 8'h1 : _GEN_59; // @
wire _GEN_61 = 8'h3d == io_addr ? 8'h1 : _GEN_60; // @
wire _GEN_62 = 8'h3e == io_addr ? 8'h1 : _GEN_61; // @
wire _GEN_63 = 8'h3f == io_addr ? 8'h1 : _GEN_62; // @
wire _GEN_64 = 8'h40 == io_addr ? 8'h1 : _GEN_63; // @
wire _GEN_65 = 8'h41 == io_addr ? 8'h1 : _GEN_64; // @
wire _GEN_66 = 8'h42 == io_addr ? 8'h1 : _GEN_65; // @
wire _GEN_67 = 8'h43 == io_addr ? 8'h1 : _GEN_66; // @
wire _GEN_68 = 8'h44 == io_addr ? 8'h1 : _GEN_67; // @
wire _GEN_69 = 8'h45 == io_addr ? 8'h1 : _GEN_68; // @
wire _GEN_70 = 8'h46 == io_addr ? 8'h1 : _GEN_69; // @
wire _GEN_71 = 8'h47 == io_addr ? 8'h1 : _GEN_70; // @
wire _GEN_72 = 8'h48 == io_addr ? 8'h1 : _GEN_71; // @
wire _GEN_73 = 8'h49 == io_addr ? 8'h1 : _GEN_72; // @
wire _GEN_74 = 8'h4a == io_addr ? 8'h1 : _GEN_73; // @
wire _GEN_75 = 8'h4b == io_addr ? 8'h1 : _GEN_74; // @
wire _GEN_76 = 8'h4c == io_addr ? 8'h1 : _GEN_75; // @
wire _GEN_77 = 8'h4d == io_addr ? 8'h1 : _GEN_76; // @
wire _GEN_78 = 8'h4e == io_addr ? 8'h1 : _GEN_77; // @
wire _GEN_79 = 8'h4f == io_addr ? 8'h1 : _GEN_78; // @
wire _GEN_80 = 8'h50 == io_addr ? 8'h1 : _GEN_79; // @
wire _GEN_81 = 8'h51 == io_addr ? 8'h1 : _GEN_80; // @
wire _GEN_82 = 8'h52 == io_addr ? 8'h1 : _GEN_81; // @
wire _GEN_83 = 8'h53 == io_addr ? 8'h1 : _GEN_82; // @
wire _GEN_84 = 8'h54 == io_addr ? 8'h1 : _GEN_83; // @
wire _GEN_85 = 8'h55 == io_addr ? 8'h1 : _GEN_84; // @
wire _GEN_86 = 8'h56 == io_addr ? 8'h1 : _GEN_85; // @
wire _GEN_87 = 8'h57 == io_addr ? 8'h1 : _GEN_86; // @
wire _GEN_88 = 8'h58 == io_addr ? 8'h1 : _GEN_87; // @
wire _GEN_89 = 8'h59 == io_addr ? 8'h1 : _GEN_88; // @
wire _GEN_90 = 8'h5a == io_addr ? 8'h1 : _GEN_89; // @
wire _GEN_91 = 8'h5b == io_addr ? 8'h1 : _GEN_90; // @
wire _GEN_92 = 8'h5c == io_addr ? 8'h1 : _GEN_91; // @
wire _GEN_93 = 8'h5d == io_addr ? 8'h1 : _GEN_92; // @
wire _GEN_94 = 8'h5e == io_addr ? 8'h1 : _GEN_93; // @
wire _GEN_95 = 8'h5f == io_addr ? 8'h1 : _GEN_94; // @
wire _GEN_96 = 8'h60 == io_addr ? 8'h1 : _GEN_95; // @
wire _GEN_97 = 8'h61 == io_addr ? 8'h1 : _GEN_96; // @
wire _GEN_98 = 8'h62 == io_addr ? 8'h1 : _GEN_97; // @
wire _GEN_99 = 8'h63 == io_addr ? 8'h1 : _GEN_98; // @
wire _GEN_100 = 8'h64 == io_addr ? 8'h1 : _GEN_99; // @
wire _GEN_101 = 8'h65 == io_addr ? 8'h1 : _GEN_100; // @
wire _GEN_102 = 8'h66 == io_addr ? 8'h1 : _GEN_101; // @
wire _GEN_103 = 8'h67 == io_addr ? 8'h1 : _GEN_102; // @
wire _GEN_104 = 8'h68 == io_addr ? 8'h1 : _GEN_103; // @
wire _GEN_105 = 8'h69 == io_addr ? 8'h1 : _GEN_104; // @
wire _GEN_106 = 8'h6a == io_addr ? 8'h1 : _GEN_105; // @
wire _GEN_107 = 8'h6b == io_addr ? 8'h1 : _GEN_106; // @
wire _GEN_108 = 8'h6c == io_addr ? 8'h1 : _GEN_107; // @
wire _GEN_109 = 8'h6d == io_addr ? 8'h1 : _GEN_108; // @
wire _GEN_110 = 8'h6e == io_addr ? 8'h1 : _GEN_109; // @
wire _GEN_111 = 8'h6f == io_addr ? 8'h1 : _GEN_110; // @
wire _GEN_112 = 8'h70 == io_addr ? 8'h1 : _GEN_111; // @
wire _GEN_113 = 8'h71 == io_addr ? 8'h1 : _GEN_112; // @
wire _GEN_114 = 8'h72 == io_addr ? 8'h1 : _GEN_113; // @
wire _GEN_115 = 8'h73 == io_addr ? 8'h1 : _GEN_114; // @
wire _GEN_116 = 8'h74 == io_addr ? 8'h1 : _GEN_115; // @
wire _GEN_117 = 8'h75 == io_addr ? 8'h1 : _GEN_116; // @
wire _GEN_118 = 8'h76 == io_addr ? 8'h1 : _GEN_117; // @
wire _GEN_119 = 8'h77 == io_addr ? 8'h1 : _GEN_118; // @
wire _GEN_120 = 8'h78 == io_addr ? 8'h1 : _GEN_119; // @
wire _GEN_121 = 8'h79 == io_addr ? 8'h1 : _GEN_120; // @
wire _GEN_122 = 8'h7a == io_addr ? 8'h1 : _GEN_121; // @
wire _GEN_123 = 8'h7b == io_addr ? 8'h1 : _GEN_122; // @
wire _GEN_124 = 8'h7c == io_addr ? 8'h1 : _GEN_123; // @
wire _GEN_125 = 8'h7d == io_addr ? 8'h1 : _GEN_124; // @
wire _GEN_126 = 8'h7e == io_addr ? 8'h1 : _GEN_125; // @
wire _GEN_127 = 8'h7f == io_addr ? 8'h1 : _GEN_126; // @
wire _GEN_128 = 8'h80 == io_addr ? 8'h1 : _GEN_127; // @
wire _GEN_129 = 8'h81 == io_addr ? 8'h1 : _GEN_128; // @
wire _GEN_130 = 8'h82 == io_addr ? 8'h1 : _GEN_129; // @
wire _GEN_131 = 8'h83 == io_addr ? 8'h1 : _GEN_130; // @
wire _GEN_132 = 8'h84 == io_addr ? 8'h1 : _GEN_131; // @
wire _GEN_133 = 8'h85 == io_addr ? 8'h1 : _GEN_132; // @
wire _GEN_134 = 8'h86 == io_addr ? 8'h1 : _GEN_133; // @
wire _GEN_135 = 8'h87 == io_addr ? 8'h1 : _GEN_134; // @
wire _GEN_136 = 8'h88 == io_addr ? 8'h1 : _GEN_135; // @
wire _GEN_137 = 8'h89 == io_addr ? 8'h1 : _GEN_136; // @
wire _GEN_138 = 8'h8a == io_addr ? 8'h1 : _GEN_137; // @
wire _GEN_139 = 8'h8b == io_addr ? 8'h1 : _GEN_138; // @
wire _GEN_140 = 8'h8c == io_addr ? 8'h1 : _GEN_139; // @
wire _GEN_141 = 8'h8d == io_addr ? 8'h1 : _GEN_140; // @
wire _GEN_142 = 8'h8e == io_addr ? 8'h1 : _GEN_141; // @
wire _GEN_143 = 8'h8f == io_addr ? 8'h1 : _GEN_142; // @
wire _GEN_144 = 8'h90 == io_addr ? 8'h1 : _GEN_143; // @
wire _GEN_145 = 8'h91 == io_addr ? 8'h1 : _GEN_144; // @
wire _GEN_146 = 8'h92 == io_addr ? 8'h1 : _GEN_145; // @
wire _GEN_147 = 8'h93 == io_addr ? 8'h1 : _GEN_146; // @
wire _GEN_148 = 8'h94 == io_addr ? 8'h1 : _GEN_147; // @
wire _GEN_149 = 8'h95 == io_addr ? 8'h1 : _GEN_148; // @
wire _GEN_150 = 8'h96 == io_addr ? 8'h1 : _GEN_149; // @
wire _GEN_151 = 8'h97 == io_addr ? 8'h1 : _GEN_150; // @
wire _GEN_152 = 8'h98 == io_addr ? 8'h1 : _GEN_151; // @
wire _GEN_153 = 8'h99 == io_addr ? 8'h1 : _GEN_152; // @
wire _GEN_154 = 8'h9a == io_addr ? 8'h1 : _GEN_153; // @
wire _GEN_155 = 8'h9b == io_addr ? 8'h1 : _GEN_154; // @
wire _GEN_156 = 8'h9c == io_addr ? 8'h1 : _GEN_155; // @
wire _GEN_157 = 8'h9d == io_addr ? 8'h1 : _GEN_156; // @
wire _GEN_158 = 8'h9e == io_addr ? 8'h1 : _GEN_157; // @
wire _GEN_159 = 8'h9f == io_addr ? 8'h1 : _GEN_158; // @
wire _GEN_160 = 8'ha0 == io_addr ? 8'h1 : _GEN_159; // @
wire _GEN_161 = 8'ha1 == io_addr ? 8'h1 : _GEN_160; // @
wire _GEN_162 = 8'ha2 == io_addr ? 8'h1 : _GEN_161; // @
wire _GEN_163 = 8'ha3 == io_addr ? 8'h1 : _GEN_162; // @
wire _GEN_164 = 8'ha4 == io_addr ? 8'h1 : _GEN_163; // @
wire _GEN_165 = 8'ha5 == io_addr ? 8'h1 : _GEN_164; // @
wire _GEN_166 = 8'ha6 == io_addr ? 8'h1 : _GEN_165; // @
wire _GEN_167 = 8'ha7 == io_addr ? 8'h1 : _GEN_166; // @
wire _GEN_168 = 8'ha8 == io_addr ? 8'h1 : _GEN_167; // @
wire _GEN_169 = 8'ha9 == io_addr ? 8'h1 : _GEN_168; // @
wire _GEN_170 = 8'haa == io_addr ? 8'h1 : _GEN_169; // @
wire _GEN_171 = 8'hab == io_addr ? 8'h1 : _GEN_170; // @
wire _GEN_172 = 8'hac == io_addr ? 8'h1 : _GEN_171; // @
wire _GEN_173 = 8'had == io_addr ? 8'h1 : _GEN_172; // @
wire _GEN_174 = 8'hae == io_addr ? 8'h1 : _GEN_173; // @
wire _GEN_175 = 8'haf == io_addr ? 8'h1 : _GEN_174; // @
wire _GEN_176 = 8'hb0 == io_addr ? 8'h1 : _GEN_175; // @
wire _GEN_177 = 8'hb1 == io_addr ? 8'h1 : _GEN_176; // @
wire _GEN_178 = 8'hb2 == io_addr ? 8'h1 : _GEN_177; // @
wire _GEN_179 = 8'hb3 == io_addr ? 8'h1 : _GEN_178; // @
wire _GEN_180 = 8'hb4 == io_addr ? 8'h1 : _GEN_179; // @
wire _GEN_181 = 8'hb5 == io_addr ? 8'h1 : _GEN_180; // @
wire _GEN_182 = 8'hb6 == io_addr ? 8'h1 : _GEN_181; // @
wire _GEN_183 = 8'hb7 == io_addr ? 8'h1 : _GEN_182; // @
wire _GEN_184 = 8'hb8 == io_addr ? 8'h1 : _GEN_183; // @
wire _GEN_185 = 8'hb9 == io_addr ? 8'h1 : _GEN_184; // @
wire _GEN_186 = 8'hba == io_addr ? 8'h1 : _GEN_185; // @
wire _GEN_187 = 8'hbb == io_addr ? 8'h1 : _GEN_186; // @
wire _GEN_188 = 8'hbc == io_addr ? 8'h1 : _GEN_187; // @
wire _GEN_189 = 8'hbd == io_addr ? 8'h1 : _GEN_188; // @
wire _GEN_190 = 8'hbe == io_addr ? 8'h1 : _GEN_189; // @
wire _GEN_191 = 8'hbf == io_addr ? 8'h1 : _GEN_190; // @
wire _GEN_192 = 8'hc0 == io_addr ? 8'h1 : _GEN_191; // @
wire _GEN_193 = 8'hc1 == io_addr ? 8'h1 : _GEN_192; // @
wire _GEN_194 = 8'hc2 == io_addr ? 8'h1 : _GEN_193; // @
wire _GEN_195 = 8'hc3 == io_addr ? 8'h1 : _GEN_194; // @
wire _GEN_196 = 8'hc4 == io_addr ? 8'h1 : _GEN_195; // @
wire _GEN_197 = 8'hc5 == io_addr ? 8'h1 : _GEN_196; // @
wire _GEN_198 = 8'hc6 == io_addr ? 8'h1 : _GEN_197; // @
wire _GEN_199 = 8'hc7 == io_addr ? 8'h1 : _GEN_198; // @
wire _GEN_200 = 8'hc8 == io_addr ? 8'h1 : _GEN_199; // @
wire _GEN_201 = 8'hc9 == io_addr ? 8'h1 : _GEN_200; // @
wire _GEN_202 = 8'hca == io_addr ? 8'h1 : _GEN_201; // @
wire _GEN_203 = 8'hcb == io_addr ? 8'h1 : _GEN_202; // @
wire _GEN_204 = 8'hcc == io_addr ? 8'h1 : _GEN_203; // @
wire _GEN_205 = 8'hcd == io_addr ? 8'h1 : _GEN_204; // @
wire _GEN_206 = 8'hce == io_addr ? 8'h1 : _GEN_205; // @
wire _GEN_207 = 8'hcf == io_addr ? 8'h1 : _GEN_206; // @
wire _GEN_208 = 8'hd0 == io_addr ? 8'h1 : _GEN_207; // @
wire _GEN_209 = 8'hd1 == io_addr ? 8'h1 : _GEN_208; // @
wire _GEN_210 = 8'hd2 == io_addr ? 8'h1 : _GEN_209; // @
wire _GEN_211 = 8'hd3 == io_addr ? 8'h1 : _GEN_210; // @
wire _GEN_212 = 8'hd4 == io_addr ? 8'h1 : _GEN_211; // @
wire _GEN_213 = 8'hd5 == io_addr ? 8'h1 : _GEN_212; // @
wire _GEN_214 = 8'hd6 == io_addr ? 8'h1 : _GEN_213; // @
wire _GEN_215 = 8'hd7 == io_addr ? 8'h1 : _GEN_214; // @
wire _GEN_216 = 8'hd8 == io_addr ? 8'h1 : _GEN_215; // @
wire _GEN_217 = 8'hd9 == io_addr ? 8'h1 : _GEN_216; // @
wire _GEN_218 = 8'hda == io_addr ? 8'h1 : _GEN_217; // @
wire _GEN_219 = 8'hdb == io_addr ? 8'h1 : _GEN_218; // @
wire _GEN_220 = 8'hdc == io_addr ? 8'h1 : _GEN_219; // @
wire _GEN_221 = 8'hdd == io_addr ? 8'h1 : _GEN_220; // @
wire _GEN_222 = 8'hde == io_addr ? 8'h1 : _GEN_221; // @
wire _GEN_223 = 8'hdf == io_addr ? 8'h1 : _GEN_222; // @
wire _GEN_224 = 8'he0 == io_addr ? 8'h1 : _GEN_223; // @
wire _GEN_225 = 8'he1 == io_addr ? 8'h1 : _GEN_224; // @
wire _GEN_226 = 8'he2 == io_addr ? 8'h1 : _GEN_225; // @
wire _GEN_227 = 8'he3 == io_addr ? 8'h1 : _GEN_226; // @
wire _GEN_228 = 8'he4 == io_addr ? 8'h1 : _GEN_227; // @
wire _GEN_229 = 8'he5 == io_addr ? 8'h1 : _GEN_228; // @
wire _GEN_230 = 8'he6 == io_addr ? 8'h1 : _GEN_229; // @
wire _GEN_231 = 8'he7 == io_addr ? 8'h1 : _GEN_230; // @
wire _GEN_232 = 8'he8 == io_addr ? 8'h1 : _GEN_231; // @
wire _GEN_233 = 8'he9 == io_addr ? 8'h1 : _GEN_232; // @
wire _GEN_234 = 8'hea == io_addr ? 8'h1 : _GEN_233; // @
wire _GEN_235 = 8'heb == io_addr ? 8'h1 : _GEN_234; // @
wire _GEN_236 = 8'hec == io_addr ? 8'h1 : _GEN_235; // @
wire _GEN_237 = 8'hed == io_addr ? 8'h1 : _GEN_236; // @
wire _GEN_238 = 8'hee == io_addr ? 8'h1 : _GEN_237; // @
wire _GEN_239 = 8'hef == io_addr ? 8'h1 : _GEN_238; // @
wire _GEN_240 = 8'hf0 == io_addr ? 8'h1 : _GEN_239; // @
wire _GEN_241 = 8'hf1 == io_addr ? 8'h1 : _GEN_240; // @
wire _GEN_242 = 8'hf2 == io_addr ? 8'h1 : _GEN_241; // @
wire _GEN_243 = 8'hf3 == io_addr ? 8'h1 : _GEN_242; // @
wire _GEN_244 = 8'hf4 == io_addr ? 8'h1 : _GEN_243; // @
wire _GEN_245 = 8'hf5 == io_addr ? 8'h1 : _GEN_244; // @
wire _GEN_246 = 8'hf6 == io_addr ? 8'h1 : _GEN_245; // @
wire _GEN_247 = 8'hf7 == io_addr ? 8'h1 : _GEN_246; // @
wire _GEN_248 = 8'hf8 == io_addr ? 8'h1 : _GEN_247; // @
wire _GEN_249 = 8'hf9 == io_addr ? 8'h1 : _GEN_248; // @
wire _GEN_250 = 8'hfa == io_addr ? 8'h1 : _GEN_249; // @
wire _GEN_251 = 8'hfb == io_addr ? 8'h1 : _GEN_250; // @
wire _GEN_252 = 8'hfc == io_addr ? 8'h1 : _GEN_251; // @
wire _GEN_253 = 8'hfd == io_addr ? 8'h1 : _GEN_252; // @
wire _GEN_254 = 8'hfe == io_addr ? 8'h1 : _GEN_253; // @
assign io_data = 8'hff == io_addr ? 8'h1 : _GEN_254; // @
endmodule
页: [1]
查看完整版本: 读取文件内容生成组合逻辑