public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jozef Lawrynowicz <jozef.l@mittosystems.com>
To: Jeff Law <law@redhat.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [MSP430][PATCH 2/2] Read MCU data from external file
Date: Tue, 13 Aug 2019 10:19:00 -0000	[thread overview]
Message-ID: <20190813105638.4d634ece@jozef-kubuntu> (raw)
In-Reply-To: <610473ce-9e01-59bb-a5b2-1fc29c2f0698@redhat.com>

On Mon, 12 Aug 2019 14:34:39 -0600
Jeff Law <law@redhat.com> wrote:

> On 8/8/19 6:17 AM, Jozef Lawrynowicz wrote:
> > This patch extends the MCU data handling so that MCU data can be provided
> > in an external file (devices.csv). This means the compiler doesn't have to be
> > updated and rebuilt to support new devices when they are released.
> > 
> > TI distribute devices.csv with other support files (header files, linker
> > scripts) on their website. I have also tested that a program builds successfully
> > for every MCU and the correct hwmult library is passed to the linker.
> > I also built the msp430 cross compiler using a trunk build of native GCC to
> > ensure all the error and warning messages added by my code are correct, as
> > checked by -Wformat-diag.
> > 
> > 
> > 0002-MSP430-Devices-2-Read-MCU-data-from-external-devices.patch
> > 
> > From 6f67cdd282f2351d7450e343314beeaa745f0159 Mon Sep 17 00:00:00 2001
> > From: Jozef Lawrynowicz <jozef.l@mittosystems.com>
> > Date: Tue, 6 Aug 2019 10:52:54 +0100
> > Subject: [PATCH 2/2] MSP430: Devices [2]: Read MCU data from external
> >  devices.csv file, if it exists
> > 
> > gcc/ChangeLog:
> > 
> > 2019-08-XX  Jozef Lawrynowicz  <jozef.l@mittosystems.com>
> > 
> > 	* gcc/config/msp430/driver-msp430.c (msp430_set_driver_var): New.
> > 	* gcc/config/msp430/msp430-devices.c (canonicalize_path_dirsep): New.
> > 	(msp430_check_path_for_devices): New.
> > 	(parse_devices_csv_1): New.
> > 	(parse_devices_csv): New.
> > 	(msp430_extract_mcu_data): Try to find devices.csv and search for the
> > 	MCU data in devices.csv before using the hard-coded data.
> > 	Warn if devices.csv isn't found and the MCU wasn't found in the
> > 	hard-coded data either.
> > 	* gcc/config/msp430/msp430.h (DRIVER_SELF_SPECS): Call
> > 	msp430_set_driver_var for -mno-warn-devices-csv and -mdevices-csv-loc.
> > 	Search for devices.csv on -I and -L paths.
> > 	(EXTRA_SPEC_FUNCTIONS): Add msp430_check_path_for_devices and
> > 	msp430_set_driver_var.
> > 	* gcc/config/msp430/msp430.opt: Add -mwarn-devices-csv and
> > 	-mdevices-csv-loc=.
> > 	* gcc/doc/invoke.texi (-mmcu): Document that -I and -L paths are
> > 	searched for devices.csv.
> > 	(mwarn-devices-csv): Document option.
> > 
> > gcc/testsuite/ChangeLog:
> > 
> > 2019-08-XX  Jozef Lawrynowicz  <jozef.l@mittosystems.com>
> > 
> > 	* gcc.target/msp430/msp430.exp (msp430_device_permutations_runtest):
> > 	Handle csv-* and bad-devices-* tests.
> > 	* gcc.target/msp430/devices/README: Document how bad-devices-* tests
> > 	work.
> > 	* gcc.target/msp430/devices/bad-devices-1.c: New test.
> > 	* gcc.target/msp430/devices/bad-devices-2.c: Likewise.
> > 	* gcc.target/msp430/devices/bad-devices-3.c: Likewise.
> > 	* gcc.target/msp430/devices/bad-devices-4.c: Likewise.
> > 	* gcc.target/msp430/devices/bad-devices-5.c: Likewise.
> > 	* gcc.target/msp430/devices/bad-devices-6.c: Likewise.
> > 	* gcc.target/msp430/devices/csv-device-order.c: Likewise.
> > 	* gcc.target/msp430/devices/csv-msp430_00.c: Likewise.
> > 	* gcc.target/msp430/devices/csv-msp430_01.c: Likewise.
> > 	* gcc.target/msp430/devices/csv-msp430_02.c: Likewise.
> > 	* gcc.target/msp430/devices/csv-msp430_04.c: Likewise.
> > 	* gcc.target/msp430/devices/csv-msp430_08.c: Likewise.
> > 	* gcc.target/msp430/devices/csv-msp430_10.c: Likewise.
> > 	* gcc.target/msp430/devices/csv-msp430_11.c: Likewise.
> > 	* gcc.target/msp430/devices/csv-msp430_12.c: Likewise.
> > 	* gcc.target/msp430/devices/csv-msp430_14.c: Likewise.
> > 	* gcc.target/msp430/devices/csv-msp430_18.c: Likewise.
> > 	* gcc.target/msp430/devices/csv-msp430_20.c: Likewise.
> > 	* gcc.target/msp430/devices/csv-msp430_21.c: Likewise.
> > 	* gcc.target/msp430/devices/csv-msp430_22.c: Likewise.
> > 	* gcc.target/msp430/devices/csv-msp430_24.c: Likewise.
> > 	* gcc.target/msp430/devices/csv-msp430_28.c: Likewise.
> > 	* gcc.target/msp430/devices/csv-msp430fr5969.c: Likewise.
> > 	* gcc.target/msp430/devices/hard-foo.c: Likewise.
> > 	* gcc.target/msp430/devices/bad-devices-1.csv: New test support file.
> > 	* gcc.target/msp430/devices/bad-devices-2.csv: Likewise.
> > 	* gcc.target/msp430/devices/bad-devices-3.csv: Likewise.
> > 	* gcc.target/msp430/devices/bad-devices-4.csv: Likewise.
> > 	* gcc.target/msp430/devices/bad-devices-5.csv: Likewise.
> > 	* gcc.target/msp430/devices/bad-devices-6.csv: Likewise.
> > 	* gcc.target/msp430/devices/devices.csv: Likewise.
> > ---  
> So it's good we don't have to do updates when a new devices.csv is
> released -- except when we devices require new multilibs, but I don't
> offhand see a sensible way to deal with that.

For a given device, the only choice to make regarding multilibs at the moment
is whether to use a 430 or 430X multilib. The large memory model multilib will
only be used if a user passes -mlarge for a 430X device.
So if a device is added which uses a new extension to the ISA (which is not
forward-compatible) and therefore needs a new multilib, we would need to update
the compiler to handle code generation for the extension anyway.

In case it wasn't clear, the hardware multiply support (which is the other
piece of data we get from devices.csv for a device) is not handled using
multilibs. Instead, the driver tells the linker which hardware multiply library
to use, of which there is only one per possible hardware multiply option.

Thanks,
Jozef
> 
> OK.
> 
> jeff

      reply	other threads:[~2019-08-13  9:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-08 12:17 [MSP430][PATCH 0/2] Improve and extend MCU data handling Jozef Lawrynowicz
2019-08-08 12:24 ` [MSP430][PATCH 1/2] Consolidate handling of hard-coded MCU data Jozef Lawrynowicz
2019-08-12 21:57   ` Jeff Law
2019-08-13  9:34     ` Jozef Lawrynowicz
2019-08-08 12:59 ` [MSP430][PATCH 2/2] Read MCU data from external file Jozef Lawrynowicz
2019-08-12 22:01   ` Jeff Law
2019-08-13 10:19     ` Jozef Lawrynowicz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190813105638.4d634ece@jozef-kubuntu \
    --to=jozef.l@mittosystems.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).