X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/14cd6d834ab531525a51c6a6992583b3e9143e02..refs/heads/master:/DelayInputModifier.cpp diff --git a/DelayInputModifier.cpp b/DelayInputModifier.cpp index a60d7e2..242547c 100644 --- a/DelayInputModifier.cpp +++ b/DelayInputModifier.cpp @@ -29,16 +29,17 @@ QString DelayInputModifier::toVHDL(int context, int flags) throw(Exception) { ConnectedInterface* toIface = AI_TO_CON(toCtlIface->getAssociatedIface()); QString toName = toIface->getOwner()->getName()+"_"+toIface->getName(); QString toCtlName = toCtlIface->getOwner()->getName()+"_"+toCtlIface->getName(); - QString dm1 = ""; QString dm2 = ""; - dm1.setNum(delayLength-1); + QString dm3 = ""; dm2.setNum(delayLength-2); + dm3.setNum(delayLength-3); QString ret=""; - QString clkName = "clk"; - QString resetName = "reset"; + int idClock = toIface->getClockDomain(); + QString clkName = "ext_clk_"+QString::number(idClock); + QString resetName = "ext_reset_"+QString::number(idClock); if (toIface->getOwner()->getParent()->isTopGroupBlock()) { - clkName = "from_clkrstgen_clk"; - resetName ="from_clkrstgen_reset"; + clkName = "from_clkrstgen_"+QString::number(idClock)+"_clk"; + resetName ="from_clkrstgen_"+QString::number(idClock)+"_reset"; } if (context == Architecture) { @@ -50,12 +51,12 @@ QString DelayInputModifier::toVHDL(int context, int flags) throw(Exception) { ret += " "+toName+"_mod <= (others => '0');\n"; ret += " "+toCtlName+"_mod <= '0';\n"; ret += " elsif rising_edge("+clkName+") then\n"; - ret += " "+toName+"_mod <= "+toName+"_dly("+dm1+");\n"; - ret += " "+toCtlName+"_mod <= "+toCtlName+"_dly("+dm1+");\n"; + ret += " "+toName+"_mod <= "+toName+"_dly("+dm2+");\n"; + ret += " "+toCtlName+"_mod <= "+toCtlName+"_dly("+dm2+");\n"; ret += " "+toName+"_dly(0) <= "+fromIface->toVHDL(AbstractInterface::Instance,0)+";\n"; ret += " "+toCtlName+"_dly(0) <= "+fromCtlIface->toVHDL(AbstractInterface::Instance,0)+";\n"; - ret += " "+toName+"_dly(1 to "+dm1+") <= "+toName+"_dly(0 to "+dm2+");\n"; - ret += " "+toCtlName+"_dly(1 to "+dm1+") <= "+toCtlName+"_dly(0 to "+dm2+");\n"; + ret += " "+toName+"_dly(1 to "+dm2+") <= "+toName+"_dly(0 to "+dm3+");\n"; + ret += " "+toCtlName+"_dly(1 to "+dm2+") <= "+toCtlName+"_dly(0 to "+dm3+");\n"; ret += " end if;\n"; ret += " end process "+toName + "_mod_process;\n"; } @@ -68,8 +69,8 @@ QString DelayInputModifier::toVHDL(int context, int flags) throw(Exception) { ret += " signal "+sig+"\n"; QString wStr=""; wStr.setNum(toIface->getWidth()); - ret += " signal "+toName+"_dly : vector_of_std_logic_vector"+wStr+"(0 to "+dm1+");\n"; - ret += " signal "+toCtlName+"_dly : vector_of_std_logic(0 to "+dm1+");\n"; + ret += " signal "+toName+"_dly : vector_of_std_logic_vector"+wStr+"(0 to "+dm2+");\n"; + ret += " signal "+toCtlName+"_dly : vector_of_std_logic(0 to "+dm2+");\n"; } return ret;