技术疑问:不应生成的Specman-BFM已创建,Tx Agent中UART BFM异常生成
Hey Sara, let's break down these two Specman BFM issues you're facing and walk through the root causes and fixes:
Issue 1: Unexpected Specman BFM Creation
First off, let's unpack why a BFM that shouldn't exist is being instantiated:
Possible Root Causes
- Inadvertent configuration enable: Check if your agent or environment config has a default setting that enables the BFM. Sometimes base classes or inherited environments have pre-enabled BFMs that you haven't overridden.
- Unconditional build code: Look through your
build()orconnect()phase logic—you might have a line likeproblem_bfm.create()that's running without a conditional check to skip it. - Cross-component dependencies: Another agent or component in your testbench might be referencing this BFM, triggering implicit instantiation even if your target agent doesn't explicitly create it.
- ConfigDB misconfiguration: If you're using Specman's configuration database, someone might have set a parameter like
set_config_object("*", "problem_bfm.create", TRUE)that forces the BFM to be created globally.
Fixes to Try
- Audit all
build_phaseimplementations in your agents and environment. Add conditional checks (likeif (enable_problem_bfm == TRUE)) to guard BFM creation. - Dump your ConfigDB settings with
print config_dbto spot any forced creation parameters, then remove or adjust them. - Use Specman's debug tools: Run
print hierarchyafter build to trace which component is initiating the BFM's creation. This will point you straight to the source code line. - If the BFM is coming from a base class, override the configuration in your subclass to disable it explicitly.
Issue 2: UART BFM Created in Tx Agent Without a Sequence Driver (active_passive Unchanged)
This one's tricky because active_passive doesn't always directly control BFM instantiation—here's what's likely going on:
Possible Root Causes
- BFM creation decoupled from driver: Your Tx Agent's code might be creating the UART BFM independently of the driver. For example, if you have
uart_bfm.create()inbuild()without wrapping it in anif (active_passive == ACTIVE)check, the BFM will spawn even if no driver is present. - Shared BFM instance: If this UART BFM is shared across multiple agents (like Tx and Rx), an active Rx Agent might be creating it first, and your Tx Agent is just picking up that existing instance (making it look like it's being created in Tx).
- Library default behavior: Some off-the-shelf BFM libraries default to creating a passive monitoring instance even when the agent is set to passive, unless you explicitly disable it.
Fixes to Try
- Tie BFM creation directly to the agent's
active_passivestate in yourbuild()logic. Example:if (active_passive == ACTIVE) { uart_bfm.create(); uart_driver.create(); uart_driver.bfm = uart_bfm; } else { // Only create BFM if you need passive monitoring; otherwise skip this line // uart_bfm.create(PASSIVE); } - Check for global BFM configurations. If there's a top-level setting like
uart_bfm_config.enable = TRUE, modify it to respect each agent'sactive_passivestatus. - For shared BFMs, move instantiation to the top-level environment instead of per-agent. This way you can control creation once and pass references to agents that need it.
- Review the BFM's internal code or documentation for a dedicated
enableparameter. Set this toFALSEin your Tx Agent's config when running passive tests.
内容的提问来源于stack exchange,提问作者Sara p
相关产品推荐
相关产品推荐

