Ignore:
Timestamp:
Feb 4, 2017, 6:49:46 AM (2 years ago)
Author:
cameron
Message:

Ability to set input/output signatures for Pablo functions in the constructor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/u8u16.cpp

    r5284 r5299  
    5151void u8u16_pablo(PabloKernel * kernel) {
    5252    //  input: 8 basis bit streams
     53   
     54    const auto u8bitSet = kernel->getInputSet("u8bit");
     55   
    5356    //  output: 16 u8-indexed streams, + delmask stream + error stream
    54 
    55     cc::CC_Compiler ccc(kernel);
     57   
     58    cc::CC_Compiler ccc(kernel, u8bitSet);
    5659   
    5760    PabloBuilder & main = ccc.getBuilder();
    5861    const auto u8_bits = ccc.getBasisBits();
    59 
     62   
    6063    Zeroes * zeroes = main.createZeroes();
    6164
     
    233236    main.createAssign(u16_lo[7], main.createOr(main.createAnd(last_byte, u8_bits[7]), s43_lo7));
    234237   
    235     Var * output = kernel->addOutput("output", kernel->getStreamSetTy(16));
    236     Var * delmask_out = kernel->addOutput("delmask_out", kernel->getStreamSetTy());
    237     Var * error_mask_out = kernel->addOutput("error_mask_out", kernel->getStreamSetTy());
     238    Var * output = kernel->getOutputSet("u16bit");
     239    Var * delmask_out = kernel->getOutputSet("delMask");
     240    Var * error_mask_out = kernel->getOutputSet("errMask");
     241   
    238242    for (unsigned i = 0; i < 8; i++) {
    239243        main.createAssign(main.createExtract(output, i), u16_hi[i]);
     
    296300    s2pk.generateKernel({&ByteStream}, {&BasisBits});
    297301
    298     PabloKernel u8u16k(iBuilder, "u8u16");
     302    PabloKernel u8u16k(iBuilder, "u8u16",
     303                       {Binding{iBuilder->getStreamSetTy(8, 1), "u8bit"}},
     304                       {Binding{iBuilder->getStreamSetTy(16, 1), "u16bit"},
     305                        Binding{iBuilder->getStreamSetTy(1, 1), "delMask"},
     306                        Binding{iBuilder->getStreamSetTy(1, 1), "errMask"}}, {});
    299307
    300308    u8u16_pablo(&u8u16k);
Note: See TracChangeset for help on using the changeset viewer.