commit | 75b0e8006dd26dfc18df644a90cd1c8a305d65ce | [log] [tgz] |
---|---|---|
author | Rupert Swarbrick <rswarbrick@lowrisc.org> | Thu Aug 05 16:27:35 2021 +0100 |
committer | Rupert Swarbrick <rswarbrick@gmail.com> | Thu Aug 05 19:20:45 2021 +0100 |
tree | c3f766e522754bfde1930324f11e2fd2891cbee3 | |
parent | d10437409f5d96cf48723525914412f2c55eb9fb [diff] |
[otbn,dv] Avoid integer overflow in coverpoint expression The expression "1 << (32 - 1)" that you get when evaluating DEF_SIGN_CP(name, value, 32) isn't representable as a signed 32-bit integer and VCS emits warnings in the build log: Warning-[CPBRM] Precision or Sign Mismatch ../src/lowrisc_dv_otbn_env_0.1/otbn_env_cov.sv, 977 Potential precision or sign mismatch in range values of user defined bin neg of coverpoint sign_a_cp in covergroup otbn_env_pkg::otbn_env_cov::insn_addsub_cg Source info: bins neg = { [(1 << 31):32'hffffffff] } ;. Values outside the valid coverpoint range will either be deleted(singleton values) or adjusted(ranges) as per the precision semantics. Intriguingly, it doesn't warn about the (1 << (32 - 1)) - 1. Apparently, the conversion to signed 32-bit integer only happens at the root of the expression tree. Make the "1" an explicit width to avoid the problem. Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
OpenTitan is an open source silicon Root of Trust (RoT) project. OpenTitan will make the silicon RoT design and implementation more transparent, trustworthy, and secure for enterprises, platform providers, and chip manufacturers. OpenTitan is administered by lowRISC CIC as a collaborative project to produce high quality, open IP for instantiation as a full-featured product. See the OpenTitan site and OpenTitan docs for more information about the project.
This repository contains hardware, software and utilities written as part of the OpenTitan project. It is structured as monolithic repository, or “monorepo”, where all components live in one repository. It exists to enable collaboration across partners participating in the OpenTitan project.
The project contains comprehensive documentation of all IPs and tools. You can access it online at docs.opentitan.org.
Have a look at CONTRIBUTING and our documentation on project organization and processes for guidelines on how to contribute code to this repository.
Unless otherwise noted, everything in this repository is covered by the Apache License, Version 2.0 (see LICENSE for full text).