Giter VIP home page Giter VIP logo

Comments (1)

KrystalDelusion avatar KrystalDelusion commented on August 17, 2024

I'm sure I've seen this bug before but can't find it now. If you replace x and o on line 93 with n % 2 and n / 2 respectively the warnings disappear. For some reason, using variables inside the index of a bus on the LHS of an expression are not fully evaluated until later than those on the RHS and more importantly later than the out of bounds check.

FWIW a smaller example would be:

module top (
	output reg  [31:0] rd_data,
	input  wire [31:0] wr_data
);
	// Signals
	// -------
	wire [31:0] mem_do_w;
	reg  [31:0] mem_di_w;

	// Map input data to/from 16*NW bit words
	always @(*)
	begin : map
		integer n, x, o;

		// Map actual bits
		for (n=0; n<8; n=n+1)
		begin
			// Determine position
			x = n % 2;	// Which SPRAM
			o = n / 2;	// Which nibble inside that SPRAM

			mem_di_w[(16*x)+(4*o)+:4] =  wr_data[4*n+:4];
			rd_data[4*n+:4] = mem_do_w[(16*x)+(4*o)+:4];
		end
	end
endmodule

And just calling the read_verilog command; the synth is unnecessary to get the warnings.

from yosys.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.