From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.50.50.238 with SMTP id f14mr62494igo.3.1392340026250; Thu, 13 Feb 2014 17:07:06 -0800 (PST) X-Received: by 10.182.28.70 with SMTP id z6mr42504obg.16.1392340026110; Thu, 13 Feb 2014 17:07:06 -0800 (PST) Path: border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!uq10no19625086igb.0!news-out.google.com!rw17ni1igc.0!nntp.google.com!c10no21155279igq.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 13 Feb 2014 17:07:05 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=187.56.108.154; posting-account=TRgI1QoAAABSsYi-ox3Pi6N-JEKKU0cu NNTP-Posting-Host: 187.56.108.154 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <215f6df2-a7ec-42f4-ac82-656d5b12bf61@googlegroups.com> Subject: Best representation for spares From: "Rego, P." Injection-Date: Fri, 14 Feb 2014 01:07:06 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Original-Bytes: 3230 Xref: number.nntp.dca.giganews.com comp.lang.ada:184848 Date: 2014-02-13T17:07:05-08:00 List-Id: When in a chip mapping, if we have spare (not used) bits, is it better to '= complete' the spaces, so now we have a contiguous type definition for all b= its; or is it better to not complete the spaces, and do not consume more st= ack than necessary? I have seen both approaches, so still did not get a con= clusion. For example, using a Raspberry Pi bits definitions for auxiliary registers = in BCM2835 chip: type Auxiliary_Interrupt_Status_Type is record Mini_Uart_IRQ : Boolean; SPI_1_IRQ : Boolean; SPI_2_IRQ : Boolean; end record; pragma Pack (Auxiliary_Interrupt_Status_Type); for Auxiliary_Interrupt_Status_Type'Size use 3; type Auxiliary_Enables_Type is record Mini_Uart_Enable : Boolean; SPI_1_Enable : Boolean; SPI_2_Enable : Boolean; end record; pragma Pack (Auxiliary_Enables_Type); for Auxiliary_Enables_Type'Size use 3; type Auxiliary_Peripherals_Register_Map_Type is record AUX_IRQ : Auxiliary_Interrupt_Status_Type; AUX_ENABLES : Auxiliary_Enables_Type; ...=20 end record; for Auxiliary_Peripherals_Register_Map_Type use record AUX_IRQ at 16#00# range 00 .. 02; AUX_ENABLES at 16#04# range 00 .. 02; end record; using this kind of definitions, the compiler warns (correctly) me=20 warning: 29-bit gap before component "AUX_ENABLES"=20 Would it be better if the definition were something like=20 type Auxiliary_Interrupt_Status_Type is record Mini_Uart_IRQ : Boolean; SPI_1_IRQ : Boolean; SPI_2_IRQ : Boolean; Spare : Some_Type_With_29_Bits;=20 end record; pragma Pack (Auxiliary_Interrupt_Status_Type); for Auxiliary_Interrupt_Status_Type'Size use 32; ... for Auxiliary_Peripherals_Register_Map_Type use record AUX_IRQ at 16#00# range 00 .. 32; AUX_ENABLES at 16#04# range 00 .. 02; end record; or just ignore the warning? Regards, Rego.