data/full_repos/permissive/445695969/src_rtl/unprotected/romulus_datapath.v
1: b'%Error: data/full_repos/permissive/445695969/src_rtl/unprotected/romulus_datapath.v:8: Cannot find include file: romulus_config_pkg.v\n`include "romulus_config_pkg.v" \n         ^~~~~~~~~~~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/445695969/src_rtl/unprotected,data/full_repos/permissive/445695969/romulus_config_pkg.v\n             data/full_repos/permissive/445695969/src_rtl/unprotected,data/full_repos/permissive/445695969/romulus_config_pkg.v.v\n             data/full_repos/permissive/445695969/src_rtl/unprotected,data/full_repos/permissive/445695969/romulus_config_pkg.v.sv\n             romulus_config_pkg.v\n             romulus_config_pkg.v.v\n             romulus_config_pkg.v.sv\n             obj_dir/romulus_config_pkg.v\n             obj_dir/romulus_config_pkg.v.v\n             obj_dir/romulus_config_pkg.v.sv\n%Error: data/full_repos/permissive/445695969/src_rtl/unprotected/romulus_datapath.v:180: Cannot find include file: romulus_config_pkg.v\n`include "romulus_config_pkg.v" \n         ^~~~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/445695969/src_rtl/unprotected/romulus_datapath.v:254: Cannot find include file: romulus_config_pkg.v\n`include "romulus_config_pkg.v" \n         ^~~~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/445695969/src_rtl/unprotected/romulus_datapath.v:295: Cannot find include file: romulus_config_pkg.v\n`include "romulus_config_pkg.v" \n         ^~~~~~~~~~~~~~~~~~~~~~\n%Error: Exiting due to 4 error(s)\n'
module romulus_datapath (

   pdo, counter,

   constant, decrypt, pdi, sdi, domain, clk, srst, senc, sen, xrst, xenc, xen,
   yrst, yenc, yen, zrst, zenc, zen, erst, correct_cnt, iv
   ) ;
`include "romulus_config_pkg.v"

   output [BUSW-1:0] pdo;
   output [55:0]     counter;

   input [CONSTW-1:0] constant;
   input [BUSW/8-1:0] decrypt;
   input [BUSW-1:0]   pdi;
   input [BUSW-1:0]   sdi;
   input [7:0]            domain;

   input                  clk;
   input                  srst, senc, sen;
   input                  xrst, xenc, xen;
   input                  yrst, yenc, yen;
   input                  zrst, zenc, zen;
   input                  erst;
   input                  correct_cnt;
   input                  iv;

   wire [128*STATESHARES-1:0] state_pg;
   wire [128*KEYSHARES-1:0]   key_pg;
   wire [127:0] 	      tweak_pg;
   wire [127:0] 	      domainseparator_pg;
   wire [CONSTW-1:0] constant_pg;

   wire [128*STATESHARES-1:0]           state;
   wire [128*KEYSHARES-1:0] key;
   wire [127:0]             tweak;
   wire [127:0]             tbcstate;
   wire [128*KEYSHARES-1:0] tkxtbc, tkxcorrect;
   wire [127:0]             tkytbc, tkycorrect;
   wire [127:0]             tkztbc, tkzcorrect, domainseparator;
   wire [127:0]             tka, tkb;
   wire [127:0]             tkc;
   wire [127:0]             tk1, tk2;
   wire [127:0]             tk3, cin;

   state_update STATE (.pdo(pdo),
                       .state_o(state),
                       .decrypt(decrypt),
                       .pdi(pdi),
                       .state_i(tbcstate),
                       .clk(clk),
                       .rst(srst),
                       .en(sen),
                       .iv(iv),
                       .tbc(senc)
                       );

   tkx_update TKEYX (.tkx(key),
                     .sdi(sdi),
                     .tkxtbc(tkxtbc),
                     .tkxcorrect(tkxcorrect),
                     .clk(clk),
                     .rst(xrst),
                     .tbc(xenc),
                     .en(xen)
                     ) ;

   tkx_update TKEYY (.tkx(tweak),
                     .sdi(pdi),
                     .tkxtbc(tkytbc),
                     .tkxcorrect(tkycorrect),
                     .clk(clk),
                     .rst(yrst),
                     .tbc(yenc),
                     .en(yen)
                     ) ;

   tkz_update TKEYZ (.tkz(domainseparator),
                     .tkztbc(tkztbc),
                     .tkzcorrect(tkzcorrect),
                     .clk(clk),
                     .rst(zrst),
                     .tbc(zenc),
                     .domain(domain),
                     .en(zen)
                     ) ;

   generate
      if (TBC == DUMMY) begin
         dummy_rnd tweakablecipher (.nextcnt(tkztbc),
                                    .nextkey(tkxtbc),
                                    .nexttweak(tkytbc),
                                    .nextstate(tbcstate),
                                    .roundkey(key_pg),
                                    .roundtweak(tweak_pg),
                                    .roundcnt(domainseparator_pg),
                                    .roundstate(state_pg),
                                    .constant(constant_pg)
                                    );

         dummy_correctfullperm PERMA (.tko(tka),.tki(key));
         dummy_correctfullperm PERMB (.tko(tkb),.tki(tweak));
         dummy_correctfullperm PERMC (.tko(tkc),.tki(domainseparator));

         dummy_lfsr2_correct LFSR3 (.so(tk1), .si(tka));
         dummy_lfsr3_correct LFSR2 (.so(tk2), .si(tkb));
      end
      else if (TBC == SKINNY) begin
	 
         skinny_rnd #(.numrnd(RNDS_PER_CLK)) tweakablecipher (.nextcnt(tkztbc),
                                                              .nextkey(tkxtbc),
                                                              .nexttweak(tkytbc),
                                                              .nextstate(tbcstate),
                                                              .roundkey(key_pg),
                                                              .roundtweak(tweak_pg),
                                                              .roundcnt(domainseparator_pg),
                                                              .roundstate(state_pg),
                                                              .constant(constant_pg)
                                                              );

         skinny_correctfullperm PERMA (.tko(tka),.tki(key));
         skinny_correctfullperm PERMB (.tko(tkb),.tki(tweak));
         skinny_correctfullperm PERMC (.tko(tkc),.tki(domainseparator));

         skinny_lfsr2_20 LFSR3 (.so(tk1), .si(tka));
         skinny_lfsr3_20 LFSR2 (.so(tk2), .si(tkb));
      end
      else if (TBC == DEOXYS) begin
         deoxys_rnd #(.numrnd(RNDS_PER_CLK)) tweakablecipher (.nextcnt(tkztbc),
                                                              .nextkey(tkxtbc),
                                                              .nexttweak(tkytbc),
                                                              .nextstate(tbcstate),
                                                              .roundkey(key_pg),
                                                              .roundtweak(tweak_pg),
                                                              .roundcnt(domainseparator_pg),
                                                              .roundstate(state_pg),
                                                              .constant(constant_pg)
                                                              );

         assign tka = key;
         assign tkb = tweak;
         assign tkc = domainseparator;

         deoxys_lfsr2_16 LFSR3 (.so(tk1), .si(tka));
         deoxys_lfsr3_16 LFSR2 (.so(tk2), .si(tkb));
      end

      if (power_gated == 1) begin
	 assign constant_pg = senc ? constant : 0;
	 assign key_pg = senc ? key : 0;
	 assign tweak_pg = senc ? tweak : 0;
	 assign state_pg = senc ? state : 0;
	 assign domainseparator_pg = senc ? domainseparator : 0;
      end
      else begin
	 assign constant_pg = constant;
	 assign key_pg = key;
	 assign tweak_pg = tweak;
	 assign state_pg = state;
	 assign domainseparator_pg = domainseparator;
      end
   endgenerate

   assign cin = correct_cnt ? domainseparator : tkc;

   lfsr_gf56 CNT (.so(tk3),.si(cin),.domain(domain));

   assign tkxcorrect = tk1;
   assign tkycorrect = tk2;
   assign tkzcorrect = tk3;

endmodule
module romulus_datapath (

   pdo, counter,

   constant, decrypt, pdi, sdi, domain, clk, srst, senc, sen, xrst, xenc, xen,
   yrst, yenc, yen, zrst, zenc, zen, erst, correct_cnt, iv
   ) ;

`include "romulus_config_pkg.v"

   output [BUSW-1:0] pdo;
   output [55:0]     counter;

   input [CONSTW-1:0] constant;
   input [BUSW/8-1:0] decrypt;
   input [BUSW-1:0]   pdi;
   input [BUSW-1:0]   sdi;
   input [7:0]            domain;

   input                  clk;
   input                  srst, senc, sen;
   input                  xrst, xenc, xen;
   input                  yrst, yenc, yen;
   input                  zrst, zenc, zen;
   input                  erst;
   input                  correct_cnt;
   input                  iv;

   wire [128*STATESHARES-1:0] state_pg;
   wire [128*KEYSHARES-1:0]   key_pg;
   wire [127:0] 	      tweak_pg;
   wire [127:0] 	      domainseparator_pg;
   wire [CONSTW-1:0] constant_pg;

   wire [128*STATESHARES-1:0]           state;
   wire [128*KEYSHARES-1:0] key;
   wire [127:0]             tweak;
   wire [127:0]             tbcstate;
   wire [128*KEYSHARES-1:0] tkxtbc, tkxcorrect;
   wire [127:0]             tkytbc, tkycorrect;
   wire [127:0]             tkztbc, tkzcorrect, domainseparator;
   wire [127:0]             tka, tkb;
   wire [127:0]             tkc;
   wire [127:0]             tk1, tk2;
   wire [127:0]             tk3, cin;

   state_update STATE (.pdo(pdo),
                       .state_o(state),
                       .decrypt(decrypt),
                       .pdi(pdi),
                       .state_i(tbcstate),
                       .clk(clk),
                       .rst(srst),
                       .en(sen),
                       .iv(iv),
                       .tbc(senc)
                       );

   tkx_update TKEYX (.tkx(key),
                     .sdi(sdi),
                     .tkxtbc(tkxtbc),
                     .tkxcorrect(tkxcorrect),
                     .clk(clk),
                     .rst(xrst),
                     .tbc(xenc),
                     .en(xen)
                     ) ;

   tkx_update TKEYY (.tkx(tweak),
                     .sdi(pdi),
                     .tkxtbc(tkytbc),
                     .tkxcorrect(tkycorrect),
                     .clk(clk),
                     .rst(yrst),
                     .tbc(yenc),
                     .en(yen)
                     ) ;

   tkz_update TKEYZ (.tkz(domainseparator),
                     .tkztbc(tkztbc),
                     .tkzcorrect(tkzcorrect),
                     .clk(clk),
                     .rst(zrst),
                     .tbc(zenc),
                     .domain(domain),
                     .en(zen)
                     ) ;

   generate
      if (TBC == DUMMY) begin
         dummy_rnd tweakablecipher (.nextcnt(tkztbc),
                                    .nextkey(tkxtbc),
                                    .nexttweak(tkytbc),
                                    .nextstate(tbcstate),
                                    .roundkey(key_pg),
                                    .roundtweak(tweak_pg),
                                    .roundcnt(domainseparator_pg),
                                    .roundstate(state_pg),
                                    .constant(constant_pg)
                                    );

         dummy_correctfullperm PERMA (.tko(tka),.tki(key));
         dummy_correctfullperm PERMB (.tko(tkb),.tki(tweak));
         dummy_correctfullperm PERMC (.tko(tkc),.tki(domainseparator));

         dummy_lfsr2_correct LFSR3 (.so(tk1), .si(tka));
         dummy_lfsr3_correct LFSR2 (.so(tk2), .si(tkb));
      end
      else if (TBC == SKINNY) begin
	 
         skinny_rnd #(.numrnd(RNDS_PER_CLK)) tweakablecipher (.nextcnt(tkztbc),
                                                              .nextkey(tkxtbc),
                                                              .nexttweak(tkytbc),
                                                              .nextstate(tbcstate),
                                                              .roundkey(key_pg),
                                                              .roundtweak(tweak_pg),
                                                              .roundcnt(domainseparator_pg),
                                                              .roundstate(state_pg),
                                                              .constant(constant_pg)
                                                              );

         skinny_correctfullperm PERMA (.tko(tka),.tki(key));
         skinny_correctfullperm PERMB (.tko(tkb),.tki(tweak));
         skinny_correctfullperm PERMC (.tko(tkc),.tki(domainseparator));

         skinny_lfsr2_20 LFSR3 (.so(tk1), .si(tka));
         skinny_lfsr3_20 LFSR2 (.so(tk2), .si(tkb));
      end
      else if (TBC == DEOXYS) begin
         deoxys_rnd #(.numrnd(RNDS_PER_CLK)) tweakablecipher (.nextcnt(tkztbc),
                                                              .nextkey(tkxtbc),
                                                              .nexttweak(tkytbc),
                                                              .nextstate(tbcstate),
                                                              .roundkey(key_pg),
                                                              .roundtweak(tweak_pg),
                                                              .roundcnt(domainseparator_pg),
                                                              .roundstate(state_pg),
                                                              .constant(constant_pg)
                                                              );

         assign tka = key;
         assign tkb = tweak;
         assign tkc = domainseparator;

         deoxys_lfsr2_16 LFSR3 (.so(tk1), .si(tka));
         deoxys_lfsr3_16 LFSR2 (.so(tk2), .si(tkb));
      end

      if (power_gated == 1) begin
	 assign constant_pg = senc ? constant : 0;
	 assign key_pg = senc ? key : 0;
	 assign tweak_pg = senc ? tweak : 0;
	 assign state_pg = senc ? state : 0;
	 assign domainseparator_pg = senc ? domainseparator : 0;
      end
      else begin
	 assign constant_pg = constant;
	 assign key_pg = key;
	 assign tweak_pg = tweak;
	 assign state_pg = state;
	 assign domainseparator_pg = domainseparator;
      end
   endgenerate

   assign cin = correct_cnt ? domainseparator : tkc;

   lfsr_gf56 CNT (.so(tk3),.si(cin),.domain(domain));

   assign tkxcorrect = tk1;
   assign tkycorrect = tk2;
   assign tkzcorrect = tk3;

endmodule