1 |
7 |
marta |
// File Name : blokmode.c
|
2 |
|
|
// Description : blokmode in C
|
3 |
|
|
// Author : Sigit Dewantoro
|
4 |
|
|
// Date : July 10th, 2001
|
5 |
|
|
|
6 |
|
|
#include<genlib.h>
|
7 |
|
|
|
8 |
|
|
main()
|
9 |
|
|
{
|
10 |
|
|
int i;
|
11 |
|
|
|
12 |
|
|
DEF_LOFIG("blokmode");
|
13 |
|
|
LOCON("data_in[0:63]", IN, "data_in[0:63]");
|
14 |
|
|
LOCON("ideam_out[0:63]", IN, "ideam_out[0:63]");
|
15 |
|
|
LOCON("rst", IN, "rst");
|
16 |
|
|
LOCON("clk", IN, "clk");
|
17 |
|
|
LOCON("en_in", IN, "en_in");
|
18 |
|
|
LOCON("en_iv", IN, "en_iv");
|
19 |
|
|
LOCON("en_rcbc", IN, "en_rcbc");
|
20 |
|
|
LOCON("en_out", IN, "en_out");
|
21 |
|
|
LOCON("sel1[0:1]", IN, "sel1[0:1]");
|
22 |
|
|
LOCON("sel2[0:1]", IN, "sel2[0:1]");
|
23 |
|
|
LOCON("sel3[0:1]", IN, "sel3[0:1]");
|
24 |
|
|
LOCON("dt_inidea[0:63]", OUT, "dt_inidea[0:63]");
|
25 |
|
|
LOCON("cp_out[0:63]", OUT, "cp_out[0:63]");
|
26 |
|
|
LOCON("vdd", IN, "vdd");
|
27 |
|
|
LOCON("vss", IN, "vss");
|
28 |
|
|
|
29 |
|
|
for (i=0;i<64;i++)
|
30 |
|
|
LOINS ("zero_x0", NAME("zero%d",i), NAME("zero64[%d]",i), "vdd", "vss", 0);
|
31 |
|
|
|
32 |
|
|
LOINS ("register64", "reg_in", "data_in[0:63]", "rst","en_in", "reg_in[0:63]", "vdd", "vss", 0);
|
33 |
|
|
LOINS ("mux64", "mux1", "xor2[63:0]", "reg_in[63:0]", "zero64[63:0]", "sel1[1:0]", "mux1[63:0]", "vdd", "vss", 0);
|
34 |
|
|
LOINS ("register64", "reg_iv","mux1[0:63]", "rst", "en_iv", "reg_iv[0:63]", "vdd", "vss", 0);
|
35 |
|
|
LOINS ("mux64", "mux2", "xor2[63:0]", "reg_iv[63:0]", "zero64[63:0]", "sel2[1:0]", "mux2[63:0]","vdd", "vss", 0);
|
36 |
|
|
LOINS ("xor64", "xor1", "mux1[63:0]", "mux2[63:0]", "dt_inidea[63:0]", "vdd", "vss", 0);
|
37 |
|
|
LOINS ("register64", "reg_cbc", "reg_iv[0:63]", "rst","en_rcbc", "reg_cbc[0:63]", "vdd", "vss", 0);
|
38 |
|
|
LOINS ("mux64", "mux3", "reg_cbc[63:0]", "reg_in[63:0]", "zero64[63:0]", "sel3[1:0]","mux3[63:0]","vdd", "vss", 0);
|
39 |
|
|
LOINS ("xor64", "xor2", "ideam_out[63:0]", "mux3[63:0]", "xor2[63:0]", "vdd", "vss", 0);
|
40 |
|
|
LOINS ("register64", "reg_out","xor2[0:63]", "rst","en_out","cp_out[0:63]", "vdd", "vss", 0);
|
41 |
|
|
|
42 |
|
|
SAVE_LOFIG();
|
43 |
|
|
exit(0);
|
44 |
|
|
}
|