Skip to content

Commit 03cf420

Browse files
committed
Added penable and psel error checking to monitor
1 parent 48299b5 commit 03cf420

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

src/agent/apb_monitor.svh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,21 @@ class apb_monitor#(`_APB_AGENT_PARAM_DEFS) extends uvm_monitor;
108108

109109
// Idle Phase
110110
if (!m_vif.psel) begin
111-
// TODO: Check no oustanding transactions
112-
// TODO: Check penable
111+
if (trans != null) begin
112+
`uvm_error(get_type_name(), "psel is low while there is an outstanding transaction")
113+
end
114+
if (m_vif.penable) begin
115+
`uvm_error(get_type_name(), "penable is high while psel is low")
116+
end
113117
continue;
114118
end
115119

116120
// Setup Phase
117121
if (trans == null) begin
118122
apb_transaction#(`_APB_AGENT_PARAM_MAP) req;
119-
// TODO: Check penable
123+
if (m_vif.penable) begin
124+
`uvm_error(get_type_name(), "penable is high during the access phase")
125+
end
120126

121127
trans = apb_transaction#(`_APB_AGENT_PARAM_MAP)::type_id::create("monitor_trans");
122128
trans.write = (m_vif.pwrite) ? APB_WRITE : APB_READ;
@@ -135,7 +141,9 @@ class apb_monitor#(`_APB_AGENT_PARAM_DEFS) extends uvm_monitor;
135141
end
136142

137143
// Access Phase
138-
// TODO: Check penable
144+
if (!m_vif.penable) begin
145+
`uvm_error(get_type_name(), "penable is low during the access phase")
146+
end
139147

140148
if (m_vif.pready && m_vif.penable) begin
141149
if (trans.write == APB_READ) begin

0 commit comments

Comments
 (0)