Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] SystemVerilog, "struct packed", module mapping issue in Encounter RTL compiler

Status
Not open for further replies.

logari84

Newbie level 6
Joined
Jul 15, 2015
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,452
SystemVerilog, "struct packed", module mapping issue in Encounter RTL compiler

Hi all,

I am trying to synthesize a design with Encounter RTL but I am having problems with a struct. I am using many structs so I am posting only one as an example.

Let's say I am using this which is defined in a separate file containing all typedefs:

Code:
typedef struct packed{
	logic[`PR_ADDRESS_WIDTH-1:0]	address;
	logic[`BITS_PER_ADC-1:0]		adc0;
	logic[`BITS_PER_ADC-1:0]		adc1;
	logic[`BITS_PER_ADC-1:0]		adc2;
	logic[`BITS_PER_ADC-1:0]		adc3;
	} T_PR_DATA;



Top module:

Code:
`include "constants.sv"
`include "types.sv"


module Top_compressor(clk, en, data_in, data_out);
input clk;
input en;
input T_PR_DATA data_in;
output reg [31:0] data_out;


T_ENCODED_ADDR_ADC enc2pckg;

encoder enc_unit(clk, en, data_in, enc2pckg);


endmodule

PR_ADDRESS_WIDTH = 16 and BITS_PER_ADC = 4. So this means that data_in is a signal of total 32 bits ([15:0][3:0][3:0][3:0][3:0])


encoder module (the one instantiated within Top)

Code:
`include "types.sv"
`include "ROM_adc_code.sv"

module encoder(
	input	logic				clk,
	input	logic				en,
	input	T_PR_DATA			data_in,
	output	T_ENCODED_ADDR_ADC	data_out
);

assign data_out.address = data_in.address;

ROM_adc_code adc0_code_LUT(
	.clk(clk),
	.address(data_in.adc0),
	.code(data_out.adc0_code),
	.CS(1'b1)
);

ROM_adc_code adc1_code_LUT(
	.clk(clk),
	.address(data_in.adc1),
	.code(data_out.adc1_code),
	.CS(1'b1)
);

ROM_adc_code adc2_code_LUT(
	.clk(clk),
	.address(data_in.adc2),
	.code(data_out.adc2_code),
	.CS(1'b1)
);

ROM_adc_code adc3_code_LUT(
	.clk(clk),
	.address(data_in.adc3),
	.code(data_out.adc3_code),
	.CS(1'b1)
);
endmodule


In ModelSim I get no errors, no warnings and the ports are mapped correctly. Though when I try to run the synthesis with Encounter RTL, I get a warning about signal width mismatch. To be more specific the tool tries to map the whole 32-bit data_in of the Top module to the 4-bit data_in.adc3 in the encoder data_in port. So either I am doing something wrong, or mapping a struct in module ports is not supported.

Any hints??

Thank you in advance.

- - - Updated - - -

Hmm... I probably found what I was doing wrong. It seems that the .* implicit port connection was the solution. I changed encoder enc_unit(clk, en, data_in, enc2pckg); with encoder enc_unit(.* , .data_out(enc2pkg)); and I only got some warnings that I don't think is something important.
 

Re: SystemVerilog, "struct packed", module mapping issue in Encounter RTL compiler

idea #1 - use systemverilog interface instead
idea #2 - stop using implicit port connection.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top