Error: could not begin a transaction

2019年10月28日15:36:06

今天使用svn  Apache 进行搭建

搭建完以后发现可以update但不能提交的一个问题:

Error: could not begin a transaction  

解决方式:

1:查看权限,如果是权限问题那么恭喜你

sudo chown -R apache:apache /var/www/svn/spring-hello-world/

将其设置成apache即可

2:不管怎么设置都没有作用,那么可以使用如下

日志文件:

SELinux is preventing httpd from write access on the 文件 /var/www/svn/spring-hello-world/db/txn-current-lock.

*****  插件 httpd_write_content (48.3 置信度) 建议  *********************************

If you want to allow httpd to have write access on the txn-current-lock file
Then 需要更改 '/var/www/svn/spring-hello-world/db/txn-current-lock' 中的标记
Do
# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/svn/spring-hello-world/db/txn-current-lock'
# restorecon -v '/var/www/svn/spring-hello-world/db/txn-current-lock'

*****  插件 restorecon (48.3 置信度) 建议  ******************************************

If you want to fix the label. 
/var/www/svn/spring-hello-world/db/txn-current-lock default label should be httpd_sys_rw_content_t.
Then you can run restorecon. The access attempt may have been stopped due to insufficient permissions to access a parent directory in which case try to change the following command accordingly.
Do
# /sbin/restorecon -v /var/www/svn/spring-hello-world/db/txn-current-lock

*****  插件 catchall_boolean (4.32 置信度) 建议  ************************************

If you want to allow httpd to unified
Then 必须启用 'httpd_unified' 布尔值告知 SELinux 此情况。

Do
setsebool -P httpd_unified 1

*****  插件 catchall (0.97 置信度) 建议  ********************************************

If you believe that httpd should be allowed write access on the txn-current-lock file by default.
Then 应该将这个情况作为 bug 报告。
可以生成本地策略模块以允许此访问。
Do
allow this access for now by executing:
# ausearch -c 'httpd' --raw | audit2allow -M my-httpd
# semodule -i my-httpd.pp

更多信息:
源环境 (Context)                 system_u:system_r:httpd_t:s0
目标环境                          unconfined_u:object_r:httpd_sys_content_t:s0
目标对象                          /var/www/svn/spring-hello-world/db/txn-current-
                              lock [ file ]
源                             httpd
源路径                           httpd
端口                            <Unknown>
主机                            localhost.localdomain
源 RPM 软件包                     
目标 RPM 软件包                    
策略 RPM                        selinux-policy-3.13.1-229.el7_6.12.noarch
Selinux 已启用                   True
策略类型                          targeted
强制模式                          Enforcing
主机名                           localhost.localdomain
平台                            Linux localhost.localdomain
                              3.10.0-957.21.3.el7.x86_64 #1 SMP Tue Jun 18
                              16:35:19 UTC 2019 x86_64 x86_64
警报计数                          32
第一个                           2019-10-28 19:48:16 CST
最后一个                          2019-10-28 23:10:32 CST
本地 ID                         f3dd7387-7be1-497b-a5e0-67e71424c600

原始核查信息
type=AVC msg=audit(1572275432.986:358): avc:  denied  { write } for  pid=10332 comm="httpd" name="txn-current-lock" dev="dm-0" ino=85751535 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:httpd_sys_content_t:s0 tclass=file permissive=0


Hash: httpd,httpd_t,httpd_sys_content_t,file,write
 

解决方式在文件里面已经说了大概的解决方式

chcon -R -t httpd_sys_rw_content_t /var/www/svn/spring-hello-world/

即可解决!

 

 

class eth_scoreboard extends uvm_scoreboard; `uvm_component_utils(eth_scoreboard) // 声明分析接口:分别接收输入激励和输出结果 uvm_analysis_imp#(mac_transaction, eth_scoreboard) in_imp; uvm_analysis_imp#(mac_transaction, eth_scoreboard) out_imp; // 存储预期输出队列和实际输出队列 mac_transaction expected_queue[$]; mac_transaction actual_queue[$]; // 构造函数与build_phase function new(string name, uvm_component parent); super.new(name, parent); endfunction function void build_phase(uvm_phase phase); super.build_phase(phase); in_imp = new("in_imp", this); out_imp = new("out_imp", this); endfunction // 输入端口数据处理方法 virtual function void write_in(mac_transaction tr); expected_queue.push_back(tr); // 存储预期结果 endfunction // 输出端口数据处理方法 virtual function void write_out(mac_transaction tr); actual_queue.push_back(tr); // 存储实际结果 compare_transactions(); // 触发比对 endfunction // 核心比对逻辑 protected function void compare_transactions(); if(expected_queue.size() == 0) begin `uvm_error("SCBD", "Unexpected transaction received") return; end mac_transaction exp_tr = expected_queue.pop_front(); if(!exp_tr.compare(actual_queue.pop_front())) begin `uvm_error("SCBD", $sformatf("Mismatch!\nExpected: %s\nActual: %s", exp_tr.sprint(), actual_tr.sprint())) end endfunction endclass我现在有报错:Error-[MFNF] Member not found /global/tools_eval/eda/synopsys/vcs/vU-2023.03-1/etc/uvm-1.2/tlm1/uvm_analysis_port.svh, 125 "this.m_imp." Could not find member 'write' in class 'eth_scoreboard', at "/proj/jx101_main/dv/x-qzhang/vip/0305_ethernet/examples/sverilog/ethernet_svt/tb_ethernet_svt_uvm_basic_sys/env/ethernet_sb.sv", 13.
最新发布
03-15
<think>嗯,用户遇到了UVM scoreboard中的'member not found'编译错误。首先,我需要确定这个错误通常是什么原因引起的。根据引用[2]中的内容,用户不应该直接使用以'm_'开头的变量,因为这些是UVM内部使用的。可能用户在scoreboard中错误地引用了这样的变量,比如m_sequencer或者其他类似的内部成员。 接下来,用户提到错误发生在调用write方法时。这可能涉及到方法的作用域问题。比如,是否在正确的类中定义了write方法,或者是否在调用时使用了正确的对象引用。例如,如果write方法是属于某个特定的组件,比如monitor或者agent,那么可能需要通过句柄来访问,比如monitor.write,而不是直接调用。 另外,引用[1]提到,scoreboard应该独立工作,不需要直接关联monitor的任务。可能用户没有正确连接组件之间的TLM端口,导致在scoreboard中无法访问到相应的write方法。检查TLM端口的连接是否正确,比如是否在agent中实例化了monitor,并将analysis端口连接到scoreboard的export。 还有可能,用户在scoreboard中没有正确声明或实现write方法。比如,如果scoreboard需要实现一个analysis端口,那么必须定义一个write函数,并且该函数的参数类型需要与传输的数据类型匹配。如果参数类型不匹配,或者函数名拼写错误,也会导致找不到成员的错误。 此外,查看引用[3],用户可能在data item中使用了继承,但未正确实例化或引用。比如,在scoreboard中处理的数据类型是否为预期的派生类,可能需要检查工厂注册或对象创建是否正确。 总结可能的解决方案步骤:检查变量名是否正确,特别是避免使用以'm_'开头的内部变量;确认write方法的定义和调用是否在正确的类中,参数是否匹配;验证TLM端口是否正确连接;检查数据类型的继承和工厂注册是否正确。</think>### UVM Scoreboard中'member not found'错误修复指南 #### 错误原因分析 该错误通常由以下原因导致: 1. **变量/方法作用域错误**:在`eth_scoreboard`类中调用了未定义或不可见的成员变量/方法,例如直接访问以`m_`开头的UVM内部变量(如`m_sequencer`)[^2]。 2. **TLM端口连接问题**:未正确连接analysis端口,导致`write`方法无法从monitor传递到scoreboard[^1]。 3. **方法未实现/参数不匹配**:`write`方法未在scoreboard中定义,或参数类型与monitor发送的transaction类型不一致。 #### 修复步骤 1. **检查变量命名冲突** - 避免直接使用`m_`开头的变量(如`m_sequencer`),改用`p_sequencer`或通过`uvm_analysis_imp`获取句柄。 - 示例错误代码: ```systemverilog if (m_sequencer.get_config(...)) // 错误:直接访问内部变量 ``` - 修正代码: ```systemverilog if (p_sequencer.get_config(...)) // 正确:通过代理访问 ``` 2. **验证TLM端口连接** - 在scoreboard中声明并实现`uvm_analysis_imp`端口和`write`方法: ```systemverilog class eth_scoreboard extends uvm_scoreboard; uvm_analysis_imp #(eth_transaction, eth_scoreboard) analysis_export; virtual function void write(eth_transaction tr); // 实现对比逻辑 endfunction endclass ``` - 在agent中连接monitor与scoreboard: ```systemverilog monitor.analysis_port.connect(scoreboard.analysis_export); ``` 3. **检查transaction类型一致性** - 确保monitor发送的transaction类型与scoreboard的`write`方法参数类型完全一致: ```systemverilog class eth_monitor extends uvm_monitor; uvm_analysis_port #(eth_transaction) analysis_port; // 声明特定类型 endclass ``` 4. **添加必要的工厂注册** - 如果涉及派生transaction类型,需使用`uvm_object_utils`注册: ```systemverilog class eth_transaction extends uvm_sequence_item; `uvm_object_utils(eth_transaction) endclass ``` #### 验证流程 ```systemverilog // 完整示例代码片段 class eth_scoreboard extends uvm_scoreboard; uvm_analysis_imp #(eth_transaction, eth_scoreboard) analysis_export; eth_transaction ref_fifo[$]; virtual function void write(eth_transaction tr); ref_fifo.push_back(tr); // 添加实际对比逻辑 endfunction endclass ```
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值