No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. class axi_env extends uvm_env;
  2. axi_env_config env_cfg_h;
  3. master_agent_top mst_agt_top;
  4. slave_agent_top slv_agt_top;
  5. virtual_sequencer vseqr_h;
  6. scoreboard sb;
  7. extern function new(string name="axi_env",uvm_component parent);
  8. extern function void build_phase(uvm_phase phase);
  9. extern function void connect_phase(uvm_phase phase);
  10. `uvm_component_utils(axi_env)
  11. endclass
  12. function axi_env::new(string name="axi_env",uvm_component parent);
  13. super.new(name,parent);
  14. endfunction
  15. function void axi_env::build_phase(uvm_phase phase);
  16. if(!uvm_config_db#(axi_env_config)::get(this,"","axi_env_config",env_cfg_h))
  17. `uvm_fatal("AXI Env","Unable to get axi env config, have you set it in test?")
  18. if(env_cfg_h.has_master_agent)
  19. begin
  20. uvm_config_db#(master_config)::set(this,"mst_agt_top*","master_config",env_cfg_h.mst_cfg_h);
  21. mst_agt_top=master_agent_top::type_id::create("mst_agt_top",this);
  22. end
  23. if(env_cfg_h.has_slave_agent)
  24. begin
  25. uvm_config_db#(slave_config)::set(this,"slv_agt_top*","slave_config",env_cfg_h.slv_cfg_h);
  26. slv_agt_top=slave_agent_top::type_id::create("slv_agt_top",this);
  27. end
  28. if(env_cfg_h.has_virtual_sequencer)
  29. begin
  30. vseqr_h=virtual_sequencer::type_id::create("vseqr_h",this);
  31. end
  32. if(env_cfg_h.has_scoreboard)
  33. sb=scoreboard::type_id::create("sb",this);
  34. super.build_phase(phase);
  35. endfunction
  36. function void axi_env::connect_phase(uvm_phase phase);
  37. if(env_cfg_h.has_virtual_sequencer)
  38. begin
  39. if(env_cfg_h.has_master_agent)
  40. begin
  41. foreach(mst_agt_top.mst_agt_h[i])
  42. vseqr_h.mst_seqr_h[i]=mst_agt_top.mst_agt_h[i].mst_seqr_h;
  43. end
  44. if(env_cfg_h.has_slave_agent)
  45. begin
  46. foreach(slv_agt_top.slv_agt_h[i])
  47. vseqr_h.slv_seqr_h[i]=slv_agt_top.slv_agt_h[i].slv_seqr_h;
  48. end
  49. end
  50. if(env_cfg_h.has_scoreboard)
  51. begin
  52. foreach(mst_agt_top.mst_agt_h[i])
  53. mst_agt_top.mst_agt_h[i].mst_mon_h.mst_mon_port.connect(sb.mst_fifo_h[i].analysis_export);
  54. foreach(slv_agt_top.slv_agt_h[i])
  55. slv_agt_top.slv_agt_h[i].slv_mon_h.slv_mon_port.connect(sb.slv_fifo_h[i].analysis_export);
  56. end
  57. endfunction