示例#1
0
// Method building PiSDFGraphDispComp
PiSDFGraph* DispComp(Archi* archi, Stack* stack) {
    PiSDFGraph* graph = CREATE(stack, PiSDFGraph)(
                            /*Edges*/    10,
                            /*Params*/   8,
                            /*InputIf*/  5,
                            /*OutputIf*/ 1,
                            /*Config*/   0,
                            /*Body*/     3,
                            /*Archi*/    archi,
                            /*Stack*/    stack);

    /* Parameters */
    PiSDFParam *param_height = graph->addHeritedParam("height", 0);
    PiSDFParam *param_width = graph->addHeritedParam("width", 1);
    PiSDFParam *param_nIter = graph->addHeritedParam("nIter", 2);
    PiSDFParam *param_scale = graph->addHeritedParam("scale", 3);
    PiSDFParam *param_minDisp = graph->addHeritedParam("minDisp", 4);
    PiSDFParam *param_maxDisp = graph->addHeritedParam("maxDisp", 5);
    PiSDFParam *param_size = graph->addDependentParam("size", "height*width");
    PiSDFParam *param_nDisp = graph->addDependentParam("nDisp", "maxDisp-minDisp+1");

    /* Vertices */
    PiSDFVertex* bo_AggregateCost = graph->addBodyVertex(
                                        /*Name*/    "AggregateCost",
                                        /*FctId*/   DISPCOMP_AGGREGATECOST_FCT,
                                        /*InData*/  4,
                                        /*OutData*/ 1,
                                        /*InParam*/ 3);
    bo_AggregateCost->addInParam(0, param_height);
    bo_AggregateCost->addInParam(1, param_width);
    bo_AggregateCost->addInParam(2, param_nIter);
//	bo_AggregateCost->isExecutableOnPE(CORE_ARM0);
    bo_AggregateCost->isExecutableOnPE(CORE_DSP0);
    bo_AggregateCost->isExecutableOnPE(CORE_DSP1);
    bo_AggregateCost->isExecutableOnPE(CORE_DSP2);
    bo_AggregateCost->isExecutableOnPE(CORE_DSP3);
    bo_AggregateCost->isExecutableOnPE(CORE_DSP4);
    bo_AggregateCost->isExecutableOnPE(CORE_DSP5);
    bo_AggregateCost->isExecutableOnPE(CORE_DSP6);
    bo_AggregateCost->isExecutableOnPE(CORE_DSP7);
    bo_AggregateCost->setTimingOnType(CORE_TYPE_C6X, "127693715", stack);
    bo_AggregateCost->setTimingOnType(CORE_TYPE_ARM, "255956368", stack);

    PiSDFVertex* bo_DisparitySelect = graph->addBodyVertex(
                                          /*Name*/    "DisparitySelect",
                                          /*FctId*/   DISPCOMP_DISPARITYSELECT_FCT,
                                          /*InData*/  4,
                                          /*OutData*/ 2,
                                          /*InParam*/ 5);
    bo_DisparitySelect->addInParam(0, param_height);
    bo_DisparitySelect->addInParam(1, param_width);
    bo_DisparitySelect->addInParam(2, param_scale);
    bo_DisparitySelect->addInParam(3, param_minDisp);
    bo_DisparitySelect->addInParam(4, param_maxDisp);
//	bo_DisparitySelect->isExecutableOnPE(CORE_ARM0);
    bo_DisparitySelect->isExecutableOnPE(CORE_DSP0);
    bo_DisparitySelect->isExecutableOnPE(CORE_DSP1);
    bo_DisparitySelect->isExecutableOnPE(CORE_DSP2);
    bo_DisparitySelect->isExecutableOnPE(CORE_DSP3);
    bo_DisparitySelect->isExecutableOnPE(CORE_DSP4);
    bo_DisparitySelect->isExecutableOnPE(CORE_DSP5);
    bo_DisparitySelect->isExecutableOnPE(CORE_DSP6);
    bo_DisparitySelect->isExecutableOnPE(CORE_DSP7);
    bo_DisparitySelect->setTimingOnType(CORE_TYPE_C6X, "43926345", stack);
    bo_DisparitySelect->setTimingOnType(CORE_TYPE_ARM, "177962862", stack);

    PiSDFVertex* bo_Br_Disp = graph->addSpecialVertex(
                                  /*Type*/    PISDF_SUBTYPE_BROADCAST,
                                  /*InData*/  1,
                                  /*OutData*/ 2,
                                  /*InParam*/ 1);
    bo_Br_Disp->addInParam(0, param_size);

    PiSDFVertex* if_rawDisparity = graph->addOutputIf(
                                       /*Name*/    "if_rawDisparity",
                                       /*InParam*/ 1);
    if_rawDisparity->addInParam(0, param_size);

    PiSDFVertex* if_offsets = graph->addInputIf(
                                  /*Name*/    "if_offsets",
                                  /*InParam*/ 2);
    if_offsets->addInParam(0, param_nDisp);
    if_offsets->addInParam(1, param_nIter);

    PiSDFVertex* if_vWeights = graph->addInputIf(
                                   /*Name*/    "if_vWeights",
                                   /*InParam*/ 2);
    if_vWeights->addInParam(0, param_size);
    if_vWeights->addInParam(1, param_nIter);

    PiSDFVertex* if_hWeights = graph->addInputIf(
                                   /*Name*/    "if_hWeights",
                                   /*InParam*/ 2);
    if_hWeights->addInParam(0, param_size);
    if_hWeights->addInParam(1, param_nIter);

    PiSDFVertex* if_dispIx = graph->addInputIf(
                                 /*Name*/    "if_dispIx",
                                 /*InParam*/ 1);
    if_dispIx->addInParam(0, param_nDisp);

    PiSDFVertex* if_cost = graph->addInputIf(
                               /*Name*/    "if_cost",
                               /*InParam*/ 2);
    if_cost->addInParam(0, param_size);
    if_cost->addInParam(1, param_nDisp);


    /* Edges */
    graph->connect(
        /*Src*/ bo_DisparitySelect, /*SrcPrt*/ 1, /*Prod*/ "(width*height+1)*1",
        /*Snk*/ bo_DisparitySelect, /*SnkPrt*/ 3, /*Cons*/ "(width*height+1)*1",
        /*Delay*/ "(size+1)*1",0);

    graph->connect(
        /*Src*/ bo_DisparitySelect, /*SrcPrt*/ 0, /*Prod*/ "(height*width)*1",
        /*Snk*/ bo_Br_Disp, /*SnkPrt*/ 0, /*Cons*/ "(size)*1",
        /*Delay*/ "0",0);

    graph->connect(
        /*Src*/ bo_Br_Disp, /*SrcPrt*/ 0, /*Prod*/ "(size)*1",
        /*Snk*/ if_rawDisparity, /*SnkPrt*/ 0, /*Cons*/ "(size)*1",
        /*Delay*/ "0",0);

    graph->connect(
        /*Src*/ bo_Br_Disp, /*SrcPrt*/ 1, /*Prod*/ "(size)*1",
        /*Snk*/ bo_DisparitySelect, /*SnkPrt*/ 2, /*Cons*/ "(width*height)*1",
        /*Delay*/ "(size)*1",0);

    graph->connect(
        /*Src*/ if_offsets, /*SrcPrt*/ 0, /*Prod*/ "(nIter)*1",
        /*Snk*/ bo_AggregateCost, /*SnkPrt*/ 2, /*Cons*/ "(nIter)*1",
        /*Delay*/ "0",0);

    graph->connect(
        /*Src*/ if_vWeights, /*SrcPrt*/ 0, /*Prod*/ "(size*nIter)*1",
        /*Snk*/ bo_AggregateCost, /*SnkPrt*/ 3, /*Cons*/ "(height*width*nIter)*1",
        /*Delay*/ "0",0);

    graph->connect(
        /*Src*/ if_hWeights, /*SrcPrt*/ 0, /*Prod*/ "(size*nIter)*1",
        /*Snk*/ bo_AggregateCost, /*SnkPrt*/ 1, /*Cons*/ "(height*width*nIter)*1",
        /*Delay*/ "0",0);

    graph->connect(
        /*Src*/ if_dispIx, /*SrcPrt*/ 0, /*Prod*/ "(nDisp)*1",
        /*Snk*/ bo_DisparitySelect, /*SnkPrt*/ 1, /*Cons*/ "(1)*1",
        /*Delay*/ "0",0);

    graph->connect(
        /*Src*/ if_cost, /*SrcPrt*/ 0, /*Prod*/ "(size*nDisp)*1",
        /*Snk*/ bo_AggregateCost, /*SnkPrt*/ 0, /*Cons*/ "(width*height)*1",
        /*Delay*/ "0",0);

    graph->connect(
        /*Src*/ bo_AggregateCost, /*SrcPrt*/ 0, /*Prod*/ "(width*height)*1",
        /*Snk*/ bo_DisparitySelect, /*SnkPrt*/ 0, /*Cons*/ "(width*height)*1",
        /*Delay*/ "0",0);

    return graph;
}
示例#2
0
// Method building PiSDFGraphRadix2_Stage
PiSDFGraph* Radix2_Stage(Archi* archi, Stack* stack){
	PiSDFGraph* graph = CREATE(stack, PiSDFGraph)(
		/*Edges*/    8,
		/*Params*/   5,
		/*InputIf*/  2,
		/*OutputIf*/ 1,
		/*Config*/   1,
		/*Body*/     4,
		/*Archi*/    archi,
		/*Stack*/    stack);

	/* Parameters */
	PiSDFParam *param_N1 = graph->addHeritedParam("N1", 0);
	PiSDFParam *param_N2 = graph->addHeritedParam("N2", 1);
	PiSDFParam *param_n1 = graph->addHeritedParam("n1", 2);
	PiSDFParam *param_p = graph->addDynamicParam("p");
	PiSDFParam *param_nDFT2 = graph->addDependentParam("nDFT2", "N2*N1/n1/2");

	/* Vertices */
	PiSDFVertex* bo_DFT_2 = graph->addBodyVertex(
		/*Name*/    "DFT_2",
		/*FctId*/   RADIX2_STAGE_DFT_2_FCT,
		/*InData*/  3,
		/*OutData*/ 2,
		/*InParam*/ 4);
	bo_DFT_2->addInParam(0, param_n1);
	bo_DFT_2->addInParam(1, param_p);
	bo_DFT_2->addInParam(2, param_N1);
	bo_DFT_2->addInParam(3, param_N2);
//	bo_DFT_2->isExecutableOnPE(CORE_ARM1);
//	bo_DFT_2->isExecutableOnPE(CORE_ARM0);
	bo_DFT_2->isExecutableOnPE(CORE_DSP0);
	bo_DFT_2->isExecutableOnPE(CORE_DSP1);
	bo_DFT_2->isExecutableOnPE(CORE_DSP2);
	bo_DFT_2->isExecutableOnPE(CORE_DSP3);
	bo_DFT_2->isExecutableOnPE(CORE_DSP4);
	bo_DFT_2->isExecutableOnPE(CORE_DSP5);
	bo_DFT_2->isExecutableOnPE(CORE_DSP6);
	bo_DFT_2->isExecutableOnPE(CORE_DSP7);
	bo_DFT_2->setTimingOnType(CORE_TYPE_C6X, "100", stack);
	bo_DFT_2->setTimingOnType(CORE_TYPE_ARM, "100", stack);

	PiSDFVertex* if_pValue = graph->addInputIf(
		/*Name*/    "if_pValue",
		/*InParam*/ 0);

	PiSDFVertex* if_in = graph->addInputIf(
		/*Name*/    "if_in",
		/*InParam*/ 2);
	if_in->addInParam(0, param_N1);
	if_in->addInParam(1, param_N2);

	PiSDFVertex* if_out = graph->addOutputIf(
		/*Name*/    "if_out",
		/*InParam*/ 2);
	if_out->addInParam(0, param_N1);
	if_out->addInParam(1, param_N2);

	PiSDFVertex* bo_F = graph->addSpecialVertex(
		/*Type*/    PISDF_SUBTYPE_FORK,
		/*InData*/  1,
		/*OutData*/ 2,
		/*InParam*/ 2);
	bo_F->addInParam(0, param_N2);
	bo_F->addInParam(1, param_p);

	PiSDFVertex* bo_J = graph->addSpecialVertex(
		/*Type*/    PISDF_SUBTYPE_JOIN,
		/*InData*/  2,
		/*OutData*/ 1,
		/*InParam*/ 2);
	bo_J->addInParam(0, param_N2);
	bo_J->addInParam(1, param_p);

	PiSDFVertex* cf_cfg = graph->addConfigVertex(
		/*Name*/    "cfg",
		/*FctId*/   RADIX2_STAGE_CFG_FCT,
		/*SubType*/ PISDF_SUBTYPE_NORMAL,
		/*InData*/  1,
		/*OutData*/ 0,
		/*InParam*/ 0,
		/*OutParam*/1);
	cf_cfg->addOutParam(0, param_p);
	cf_cfg->isExecutableOnPE(CORE_ARM0);
//	cf_cfg->isExecutableOnPE(CORE_ARM1);
//	cf_cfg->isExecutableOnPE(CORE_ARM2);
//	cf_cfg->isExecutableOnPE(CORE_ARM3);
	cf_cfg->setTimingOnType(CORE_TYPE_C6X, "100", stack);
	cf_cfg->setTimingOnType(CORE_TYPE_ARM, "100", stack);

	PiSDFVertex* bo_genIx = graph->addBodyVertex(
		/*Name*/    "genIx",
		/*FctId*/   RADIX2_STAGE_GENIX_FCT,
		/*InData*/  0,
		/*OutData*/ 1,
		/*InParam*/ 1);
	bo_genIx->addInParam(0, param_nDFT2);
//	bo_genIx->isExecutableOnPE(CORE_ARM0);
	bo_genIx->isExecutableOnPE(CORE_ARM1);
	bo_genIx->isExecutableOnPE(CORE_ARM2);
	bo_genIx->isExecutableOnPE(CORE_ARM3);
//	bo_genIx->isExecutableOnPE(CORE_DSP0);
//	bo_genIx->isExecutableOnPE(CORE_DSP1);
//	bo_genIx->isExecutableOnPE(CORE_DSP2);
//	bo_genIx->isExecutableOnPE(CORE_DSP3);
	bo_genIx->setTimingOnType(CORE_TYPE_C6X, "100", stack);
	bo_genIx->setTimingOnType(CORE_TYPE_ARM, "100", stack);


	/* Edges */
	graph->connect(
		/*Src*/ if_pValue, /*SrcPrt*/ 0, /*Prod*/ "(1)*4",
		/*Snk*/ cf_cfg, /*SnkPrt*/ 0, /*Cons*/ "(1)*4",
		/*Delay*/ "0",0);

	graph->connect(
		/*Src*/ if_in, /*SrcPrt*/ 0, /*Prod*/ "(N1*N2)*4",
		/*Snk*/ bo_F, /*SnkPrt*/ 0, /*Cons*/ "(N2*(2^(p+1)))*4",
		/*Delay*/ "0",0);

	graph->connect(
		/*Src*/ bo_F, /*SrcPrt*/ 0, /*Prod*/ "(N2*(2^p))*4",
		/*Snk*/ bo_DFT_2, /*SnkPrt*/ 0, /*Cons*/ "(n1)*4",
		/*Delay*/ "0",0);

	graph->connect(
		/*Src*/ bo_F, /*SrcPrt*/ 1, /*Prod*/ "(N2*(2^p))*4",
		/*Snk*/ bo_DFT_2, /*SnkPrt*/ 1, /*Cons*/ "(n1)*4",
		/*Delay*/ "0",0);

	graph->connect(
		/*Src*/ bo_DFT_2, /*SrcPrt*/ 0, /*Prod*/ "(n1)*4",
		/*Snk*/ bo_J, /*SnkPrt*/ 0, /*Cons*/ "(N2*(2^p))*4",
		/*Delay*/ "0",0);

	graph->connect(
		/*Src*/ bo_DFT_2, /*SrcPrt*/ 1, /*Prod*/ "(n1)*4",
		/*Snk*/ bo_J, /*SnkPrt*/ 1, /*Cons*/ "(N2*(2^p))*4",
		/*Delay*/ "0",0);

	graph->connect(
		/*Src*/ bo_J, /*SrcPrt*/ 0, /*Prod*/ "(N2*(2^(p+1)))*4",
		/*Snk*/ if_out, /*SnkPrt*/ 0, /*Cons*/ "(N1*N2)*4",
		/*Delay*/ "0",0);

	graph->connect(
		/*Src*/ bo_genIx, /*SrcPrt*/ 0, /*Prod*/ "(nDFT2)*4",
		/*Snk*/ bo_DFT_2, /*SnkPrt*/ 2, /*Cons*/ "(1)*4",
		/*Delay*/ "0",0);

	return graph;
}
示例#3
0
// Method building PiSDFGraphcostParallel
PiSDFGraph* costParallel(Archi* archi, Stack* stack) {
    PiSDFGraph* graph = CREATE(stack, PiSDFGraph)(
                            /*Edges*/    18,
                            /*Params*/   9,
                            /*InputIf*/  5,
                            /*OutputIf*/ 1,
                            /*Config*/   0,
                            /*Body*/     9,
                            /*Archi*/    archi,
                            /*Stack*/    stack);

    /* Parameters */
    PiSDFParam *param_nIter = graph->addHeritedParam("nIter", 0);
    PiSDFParam *param_height = graph->addHeritedParam("height", 1);
    PiSDFParam *param_width = graph->addHeritedParam("width", 2);
    PiSDFParam *param_maxDisp = graph->addHeritedParam("maxDisp", 3);
    PiSDFParam *param_minDisp = graph->addHeritedParam("minDisp", 4);
    PiSDFParam *param_truncValue = graph->addHeritedParam("truncValue", 5);
    PiSDFParam *param_scale = graph->addHeritedParam("scale", 6);
    PiSDFParam *param_size = graph->addDependentParam("size", "height*width");
    PiSDFParam *param_nDisp = graph->addDependentParam("nDisp", "maxDisp-minDisp+1");

    /* Vertices */
    PiSDFVertex* if_cenL = graph->addInputIf(
                               /*Name*/    "if_cenL",
                               /*InParam*/ 1);
    if_cenL->addInParam(0, param_size);

    PiSDFVertex* if_cenR = graph->addInputIf(
                               /*Name*/    "if_cenR",
                               /*InParam*/ 1);
    if_cenR->addInParam(0, param_size);

    PiSDFVertex* if_grayL = graph->addInputIf(
                                /*Name*/    "if_grayL",
                                /*InParam*/ 1);
    if_grayL->addInParam(0, param_size);

    PiSDFVertex* if_grayR = graph->addInputIf(
                                /*Name*/    "if_grayR",
                                /*InParam*/ 1);
    if_grayR->addInParam(0, param_size);

    PiSDFVertex* if_rgb = graph->addInputIf(
                              /*Name*/    "if_rgb",
                              /*InParam*/ 1);
    if_rgb->addInParam(0, param_size);

    PiSDFVertex* bo_Br_rgb = graph->addSpecialVertex(
                                 /*Type*/    PISDF_SUBTYPE_BROADCAST,
                                 /*InData*/  1,
                                 /*OutData*/ 2,
                                 /*InParam*/ 1);
    bo_Br_rgb->addInParam(0, param_size);

    PiSDFVertex* bo_GenIx = graph->addBodyVertex(
                                /*Name*/    "GenIx",
                                /*FctId*/   COSTPARALLEL_GENIX_FCT,
                                /*InData*/  0,
                                /*OutData*/ 1,
                                /*InParam*/ 1);
    bo_GenIx->addInParam(0, param_nIter);
    bo_GenIx->isExecutableOnPE(CORE_ARM0);
    bo_GenIx->setTimingOnType(CORE_TYPE_ARM, "3330", stack);

    PiSDFVertex* bo_GenDisp = graph->addBodyVertex(
                                  /*Name*/    "GenDisp",
                                  /*FctId*/   COSTPARALLEL_GENDISP_FCT,
                                  /*InData*/  0,
                                  /*OutData*/ 1,
                                  /*InParam*/ 2);
    bo_GenDisp->addInParam(0, param_minDisp);
    bo_GenDisp->addInParam(1, param_maxDisp);
    bo_GenDisp->isExecutableOnPE(CORE_ARM0);
    bo_GenDisp->setTimingOnType(CORE_TYPE_ARM, "4025", stack);

    PiSDFVertex* bo_VWeights = graph->addBodyVertex(
                                   /*Name*/    "VWeights",
                                   /*FctId*/   COSTPARALLEL_VWEIGHTS_FCT,
                                   /*InData*/  2,
                                   /*OutData*/ 1,
                                   /*InParam*/ 2);
    bo_VWeights->addInParam(0, param_height);
    bo_VWeights->addInParam(1, param_width);
//	bo_VWeights->isExecutableOnPE(CORE_ARM0);
    bo_VWeights->isExecutableOnPE(CORE_DSP0);
    bo_VWeights->isExecutableOnPE(CORE_DSP1);
    bo_VWeights->isExecutableOnPE(CORE_DSP2);
    bo_VWeights->isExecutableOnPE(CORE_DSP3);
    bo_VWeights->isExecutableOnPE(CORE_DSP4);
    bo_VWeights->isExecutableOnPE(CORE_DSP5);
    bo_VWeights->isExecutableOnPE(CORE_DSP6);
    bo_VWeights->isExecutableOnPE(CORE_DSP7);
    bo_VWeights->setTimingOnType(CORE_TYPE_C6X, "58039643", stack);
    bo_VWeights->setTimingOnType(CORE_TYPE_ARM, "219177142", stack);

    PiSDFVertex* bo_HWeight = graph->addBodyVertex(
                                  /*Name*/    "HWeight",
                                  /*FctId*/   COSTPARALLEL_HWEIGHT_FCT,
                                  /*InData*/  2,
                                  /*OutData*/ 1,
                                  /*InParam*/ 2);
    bo_HWeight->addInParam(0, param_height);
    bo_HWeight->addInParam(1, param_width);
//	bo_HWeight->isExecutableOnPE(CORE_ARM0);
    bo_HWeight->isExecutableOnPE(CORE_DSP0);
    bo_HWeight->isExecutableOnPE(CORE_DSP1);
    bo_HWeight->isExecutableOnPE(CORE_DSP2);
    bo_HWeight->isExecutableOnPE(CORE_DSP3);
    bo_HWeight->isExecutableOnPE(CORE_DSP4);
    bo_HWeight->isExecutableOnPE(CORE_DSP5);
    bo_HWeight->isExecutableOnPE(CORE_DSP6);
    bo_HWeight->isExecutableOnPE(CORE_DSP7);
    bo_HWeight->setTimingOnType(CORE_TYPE_C6X, "57467063", stack);
    bo_HWeight->setTimingOnType(CORE_TYPE_ARM, "217559830", stack);

    PiSDFVertex* bo_CostConstruction = graph->addBodyVertex(
                                           /*Name*/    "CostConstruction",
                                           /*FctId*/   COSTPARALLEL_COSTCONSTRUCTION_FCT,
                                           /*InData*/  5,
                                           /*OutData*/ 1,
                                           /*InParam*/ 3);
    bo_CostConstruction->addInParam(0, param_truncValue);
    bo_CostConstruction->addInParam(1, param_height);
    bo_CostConstruction->addInParam(2, param_width);
//	bo_CostConstruction->isExecutableOnPE(CORE_ARM0);
    bo_CostConstruction->isExecutableOnPE(CORE_DSP0);
    bo_CostConstruction->isExecutableOnPE(CORE_DSP1);
    bo_CostConstruction->isExecutableOnPE(CORE_DSP2);
    bo_CostConstruction->isExecutableOnPE(CORE_DSP3);
    bo_CostConstruction->isExecutableOnPE(CORE_DSP4);
    bo_CostConstruction->isExecutableOnPE(CORE_DSP5);
    bo_CostConstruction->isExecutableOnPE(CORE_DSP6);
    bo_CostConstruction->isExecutableOnPE(CORE_DSP7);
    bo_CostConstruction->setTimingOnType(CORE_TYPE_C6X, "39526772", stack);
    bo_CostConstruction->setTimingOnType(CORE_TYPE_ARM, "237452231", stack);

    PiSDFVertex* if_rawDisparity = graph->addOutputIf(
                                       /*Name*/    "if_rawDisparity",
                                       /*InParam*/ 1);
    if_rawDisparity->addInParam(0, param_size);

    PiSDFVertex* bo_Br_Ix = graph->addSpecialVertex(
                                /*Type*/    PISDF_SUBTYPE_BROADCAST,
                                /*InData*/  1,
                                /*OutData*/ 3,
                                /*InParam*/ 1);
    bo_Br_Ix->addInParam(0, param_nIter);

    PiSDFVertex* bo_Br_Disp = graph->addSpecialVertex(
                                  /*Type*/    PISDF_SUBTYPE_BROADCAST,
                                  /*InData*/  1,
                                  /*OutData*/ 2,
                                  /*InParam*/ 1);
    bo_Br_Disp->addInParam(0, param_nDisp);

    PiSDFVertex* bo_DispComp = graph->addHierVertex(
                                   /*Name*/    "DispComp",
                                   /*Graph*/   DispComp(archi, stack),
                                   /*InData*/  5,
                                   /*OutData*/ 1,
                                   /*InParam*/ 6);
    bo_DispComp->addInParam(0, param_height);
    bo_DispComp->addInParam(1, param_width);
    bo_DispComp->addInParam(2, param_nIter);
    bo_DispComp->addInParam(3, param_scale);
    bo_DispComp->addInParam(4, param_minDisp);
    bo_DispComp->addInParam(5, param_maxDisp);


    /* Edges */
    graph->connect(
        /*Src*/ bo_DispComp, /*SrcPrt*/ 0, /*Prod*/ "(height*width)*1",
        /*Snk*/ if_rawDisparity, /*SnkPrt*/ 0, /*Cons*/ "(size)*1",
        /*Delay*/ "0",0);

    graph->connect(
        /*Src*/ bo_CostConstruction, /*SrcPrt*/ 0, /*Prod*/ "(height*width)*1",
        /*Snk*/ bo_DispComp, /*SnkPrt*/ 4, /*Cons*/ "(height*width*(maxDisp-minDisp+1))*1",
        /*Delay*/ "0",0);

    graph->connect(
        /*Src*/ bo_VWeights, /*SrcPrt*/ 0, /*Prod*/ "(height*width)*1",
        /*Snk*/ bo_DispComp, /*SnkPrt*/ 1, /*Cons*/ "(height*width*nIter)*1",
        /*Delay*/ "0",0);

    graph->connect(
        /*Src*/ bo_HWeight, /*SrcPrt*/ 0, /*Prod*/ "(height*width)*1",
        /*Snk*/ bo_DispComp, /*SnkPrt*/ 2, /*Cons*/ "(height*width*nIter)*1",
        /*Delay*/ "0",0);

    graph->connect(
        /*Src*/ if_rgb, /*SrcPrt*/ 0, /*Prod*/ "(size)*3",
        /*Snk*/ bo_Br_rgb, /*SnkPrt*/ 0, /*Cons*/ "(size)*3",
        /*Delay*/ "0",0);

    graph->connect(
        /*Src*/ bo_GenIx, /*SrcPrt*/ 0, /*Prod*/ "(nIter)*1",
        /*Snk*/ bo_Br_Ix, /*SnkPrt*/ 0, /*Cons*/ "(nIter)*1",
        /*Delay*/ "0",0);

    graph->connect(
        /*Src*/ bo_GenDisp, /*SrcPrt*/ 0, /*Prod*/ "(maxDisp-minDisp+1)*1",
        /*Snk*/ bo_Br_Disp, /*SnkPrt*/ 0, /*Cons*/ "(nDisp)*1",
        /*Delay*/ "0",0);

    graph->connect(
        /*Src*/ bo_Br_Disp, /*SrcPrt*/ 0, /*Prod*/ "(nDisp)*1",
        /*Snk*/ bo_CostConstruction, /*SnkPrt*/ 0, /*Cons*/ "(1)*1",
        /*Delay*/ "0",0);

    graph->connect(
        /*Src*/ bo_Br_Disp, /*SrcPrt*/ 1, /*Prod*/ "(nDisp)*1",
        /*Snk*/ bo_DispComp, /*SnkPrt*/ 3, /*Cons*/ "(maxDisp-minDisp+1)*1",
        /*Delay*/ "0",0);

    graph->connect(
        /*Src*/ bo_Br_Ix, /*SrcPrt*/ 0, /*Prod*/ "(nIter)*1",
        /*Snk*/ bo_DispComp, /*SnkPrt*/ 0, /*Cons*/ "(nIter)*1",
        /*Delay*/ "0",0);

    graph->connect(
        /*Src*/ bo_Br_Ix, /*SrcPrt*/ 1, /*Prod*/ "(nIter)*1",
        /*Snk*/ bo_HWeight, /*SnkPrt*/ 0, /*Cons*/ "(1)*1",
        /*Delay*/ "0",0);

    graph->connect(
        /*Src*/ bo_Br_Ix, /*SrcPrt*/ 2, /*Prod*/ "(nIter)*1",
        /*Snk*/ bo_VWeights, /*SnkPrt*/ 0, /*Cons*/ "(1)*1",
        /*Delay*/ "0",0);

    graph->connect(
        /*Src*/ bo_Br_rgb, /*SrcPrt*/ 0, /*Prod*/ "(size)*3",
        /*Snk*/ bo_HWeight, /*SnkPrt*/ 1, /*Cons*/ "(height*width)*3",
        /*Delay*/ "0",0);

    graph->connect(
        /*Src*/ bo_Br_rgb, /*SrcPrt*/ 1, /*Prod*/ "(size)*3",
        /*Snk*/ bo_VWeights, /*SnkPrt*/ 1, /*Cons*/ "(height*width)*3",
        /*Delay*/ "0",0);

    graph->connect(
        /*Src*/ if_cenL, /*SrcPrt*/ 0, /*Prod*/ "(size)*1",
        /*Snk*/ bo_CostConstruction, /*SnkPrt*/ 1, /*Cons*/ "(height*width)*1",
        /*Delay*/ "0",0);

    graph->connect(
        /*Src*/ if_cenR, /*SrcPrt*/ 0, /*Prod*/ "(size)*1",
        /*Snk*/ bo_CostConstruction, /*SnkPrt*/ 2, /*Cons*/ "(height*width)*1",
        /*Delay*/ "0",0);

    graph->connect(
        /*Src*/ if_grayL, /*SrcPrt*/ 0, /*Prod*/ "(size)*1",
        /*Snk*/ bo_CostConstruction, /*SnkPrt*/ 3, /*Cons*/ "(height*width)*1",
        /*Delay*/ "0",0);

    graph->connect(
        /*Src*/ if_grayR, /*SrcPrt*/ 0, /*Prod*/ "(size)*1",
        /*Snk*/ bo_CostConstruction, /*SnkPrt*/ 4, /*Cons*/ "(height*width)*1",
        /*Delay*/ "0",0);

    return graph;
}
示例#4
0
// Method building PiSDFGraphDFT_Radix2
PiSDFGraph* DFT_Radix2(Archi* archi, Stack* stack){
	PiSDFGraph* graph = CREATE(stack, PiSDFGraph)(
		/*Edges*/    4,
		/*Params*/   5,
		/*InputIf*/  1,
		/*OutputIf*/ 1,
		/*Config*/   0,
		/*Body*/     3,
		/*Archi*/    archi,
		/*Stack*/    stack);

	/* Parameters */
	PiSDFParam *param_N1 = graph->addHeritedParam("N1", 0);
	PiSDFParam *param_N2 = graph->addHeritedParam("N2", 1);
	PiSDFParam *param_n1 = graph->addHeritedParam("n1", 2);
	PiSDFParam *param_P = graph->addHeritedParam("P", 3);
	PiSDFParam *param_size = graph->addDependentParam("size", "N1*N2");

	/* Vertices */
	PiSDFVertex* bo_Br = graph->addSpecialVertex(
		/*Type*/    PISDF_SUBTYPE_BROADCAST,
		/*InData*/  1,
		/*OutData*/ 2,
		/*InParam*/ 1);
	bo_Br->addInParam(0, param_size);

	PiSDFVertex* if_out = graph->addOutputIf(
		/*Name*/    "if_out",
		/*InParam*/ 1);
	if_out->addInParam(0, param_size);

	PiSDFVertex* if_in = graph->addInputIf(
		/*Name*/    "if_in",
		/*InParam*/ 1);
	if_in->addInParam(0, param_size);

	PiSDFVertex* bo_genIx = graph->addBodyVertex(
		/*Name*/    "genIx",
		/*FctId*/   DFT_RADIX2_GENIX_FCT,
		/*InData*/  0,
		/*OutData*/ 1,
		/*InParam*/ 1);
	bo_genIx->addInParam(0, param_P);
//	bo_genIx->isExecutableOnPE(CORE_ARM0);
//	bo_genIx->isExecutableOnPE(CORE_ARM1);
//	bo_genIx->isExecutableOnPE(CORE_ARM2);
//	bo_genIx->isExecutableOnPE(CORE_ARM3);
	bo_genIx->isExecutableOnPE(CORE_DSP0);
	bo_genIx->isExecutableOnPE(CORE_DSP1);
	bo_genIx->isExecutableOnPE(CORE_DSP2);
	bo_genIx->isExecutableOnPE(CORE_DSP3);
	bo_genIx->setTimingOnType(CORE_TYPE_C6X, "100", stack);
	bo_genIx->setTimingOnType(CORE_TYPE_ARM, "100", stack);

	PiSDFVertex* bo_Radix2_Stage = graph->addHierVertex(
		/*Name*/    "Radix2_Stage",
		/*Graph*/   Radix2_Stage(archi, stack),
		/*InData*/  2,
		/*OutData*/ 1,
		/*InParam*/ 3);
	bo_Radix2_Stage->addInParam(0, param_N1);
	bo_Radix2_Stage->addInParam(1, param_N2);
	bo_Radix2_Stage->addInParam(2, param_n1);


	/* Edges */
	graph->connect(
		/*Src*/ bo_genIx, /*SrcPrt*/ 0, /*Prod*/ "(P)*4",
		/*Snk*/ bo_Radix2_Stage, /*SnkPrt*/ 0, /*Cons*/ "(1)*4",
		/*Delay*/ "0",0);

	graph->connect(
		/*Src*/ bo_Radix2_Stage, /*SrcPrt*/ 0, /*Prod*/ "(N1*N2)*4",
		/*Snk*/ bo_Br, /*SnkPrt*/ 0, /*Cons*/ "(size)*4",
		/*Delay*/ "0",0);

	graph->connect(
		/*Src*/ bo_Br, /*SrcPrt*/ 0, /*Prod*/ "(size)*4",
		/*Snk*/ if_out, /*SnkPrt*/ 0, /*Cons*/ "(size)*4",
		/*Delay*/ "0",0);

	graph->connect(
		/*Src*/ bo_Br, /*SrcPrt*/ 1, /*Prod*/ "(size)*4",
		/*Snk*/ bo_Radix2_Stage, /*SnkPrt*/ 1, /*Cons*/ "(N1*N2)*4",
		/*Delay*/ "(size)*4",if_in);

	return graph;
}