From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id 211FE393A41E for ; Mon, 8 Feb 2021 12:12:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 211FE393A41E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=andrew.burgess@embecosm.com Received: by mail-wr1-x433.google.com with SMTP id g6so3798250wrs.11 for ; Mon, 08 Feb 2021 04:12:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=+snmLqzhWkl6Z3xJxvr0D3ejLKQ3YWfGnAZTeDbCLkI=; b=Mgv6sWqu4Bg4ogivTU159kNxZ9FH8AWB7mtBtoq1d+yzrZ9BTm++iHYU0oNCKOaeR2 M6qvBBXaS//0qsJp/MSUdJd39CKnCAEdXtVw0kjCG+EKouoG38BEcvsUoAqoZvX8iel4 Q3Yk9ex58m/r90fpfS2h6n7Pe5T2/hfHROYDpyX7ooZCnqAJF1ocCMgEYOuFhVOup8Qi oC4FMkWFqkpGrhzQOkTYEtZbutMYUgLMmAZ3gWn3/ca7LdL7G7cmcKvuAC0c+zYCxc3U xu7UBQlj+cMwlENgtchL2T0R8vTK0+NbG2uA987m97RuqaCd4t2FjIdR1qs8FzBfv+Eq apjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=+snmLqzhWkl6Z3xJxvr0D3ejLKQ3YWfGnAZTeDbCLkI=; b=YoM0Uoky8FNg0Vhk3F/XiXkCBetlIT4+d9QgQRYVx7E2RIwNlB8ukaS8irVEXGPIGH tqeVijWl9Sjp6xFM0itkzwszh2+FTQp/ySPiUjgNbcr8q6XE1KFL6MsJXyzzs4W4Wz6Y 5M0KbOq3ieiU0/IJ4Z4qxQb1ZWSEvvYRqLHq+T7mmBJMW0/ORLSzTy29X3NDTi74cZgK //uOfa4YdATZBB2Qbozd2m6x+8Z+kxXNpx6mB1A7H/VfGkgOCnOMqXEIbzI/G3xOfO4F YC29S+MpiHstHy5LN73Y7r0yO/6f+aPAlzMGXDyVr+vH+J7GBLmL1wg/IA9SyNx1K3Yr bHQQ== X-Gm-Message-State: AOAM533+YFvdm6QDla/HmRkDNF7UYJWVQdocEinGWX0ZG9xKGNjnX1Sh ADVMIQJSfe0XXWFpOGjizNGpoIzddlMZCw== X-Google-Smtp-Source: ABdhPJzbE8yY3dsZRQjQx/nllP6QB2nbSDGykqXsg0IcfiSjUwX7PVeqeprbqDkx5yjLLIjj/BvDJg== X-Received: by 2002:adf:dd83:: with SMTP id x3mr19333938wrl.421.1612786366877; Mon, 08 Feb 2021 04:12:46 -0800 (PST) Received: from localhost (host109-151-46-64.range109-151.btcentralplus.com. [109.151.46.64]) by smtp.gmail.com with ESMTPSA id f7sm14852635wrm.92.2021.02.08.04.12.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Feb 2021 04:12:46 -0800 (PST) Date: Mon, 8 Feb 2021 12:12:45 +0000 From: Andrew Burgess To: gdb-patches@sourceware.org Subject: Re: [PATCH] sim: testsuite: push $arch out to targets Message-ID: <20210208121245.GG265215@embecosm.com> References: <20210117160945.1362-1-vapier@gentoo.org> <20210118095201.GN265215@embecosm.com> <20210121092253.GW265215@embecosm.com> <20210131105438.GQ265215@embecosm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux/5.8.13-100.fc31.x86_64 (x86_64) X-Uptime: 12:04:22 up 61 days, 16:48, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 12:12:50 -0000 * Mike Frysinger via Gdb-patches [2021-01-31 14:41:17 -0500]: > On 31 Jan 2021 10:54, Andrew Burgess wrote: > > * Mike Frysinger [2021-01-22 01:36:05 -0500]: > > > On 21 Jan 2021 09:22, Andrew Burgess wrote: > > > > * Mike Frysinger [2021-01-18 13:01:53 -0500]: > > > > > On 18 Jan 2021 09:52, Andrew Burgess wrote: > > > > > > * Mike Frysinger [2021-01-17 11:09:45 -0500]: > > > > > > > This is needed to move to automake & its dejagnu-provided logic, > > > > > > > and eventually by the unified sim logic. > > > > > > > > > > > > I looked through this patch and I didn't understand what's going on > > > > > > here. > > > > > > > > > > > > If this needs doing at all, could it not be done in some global location? > > > > > > > > > > the sim ports use a unique subdir for their `run` program. the tests > > > > > need to find that path. this $arch value is what binds the specific > > > > > subdir to the test. > > > > > > > > I don't understand that paragraph I'm afraid. > > > > > > > > I guess my question is each *.exp file gets invoked by dejagnu, but > > > > there are other hooks that dejagnu calls, like the ${tool}_init proc. > > > > Could we not use that to set these things instead? It seems like > > > > there's a 1:1 mapping between [istarget ????] patterns and the values > > > > pushed into both arch and all_machs. > > > > > > i'm not seeing how any hooks would help. the targets need to know where > > > their sim program lives. let me brain dump on you :p. > > > > > > lets look at a bfin & frv build tree. > > > build-bfin-elf/ > > > `-- sim/ > > > `-- bfin/ > > > `-- run > > > build-frv-elf/ > > > `-- sim/ > > > `-- frv/ > > > `-- run > > > > > > sim/testsuite/frv/*.exp files need to know to look for $(builddir)/frv/run > > > while sim/testsuite/bfin/*.exp files need $(builddir)/bfin/run. > > > > > > i know the variable is called $arch and that can be confusing. i could > > > rename it if it helps. just keep in mind that this is used for exactly > > > one thing: where to find `run` under $(builddir)/. > > > > > > when we invoke dejagnu, it was with --tool=sim. if we had combined trees > > > with other tools (gas/gdb/etc...), this would make sense, but it doesn't, > > > so we changed it to --tool="". now when you run `runtest`, it will find > > > all *.exp files under sim/testsuite/ and attempt to execute them. > > > > OK. I don't understand why changing tool from "sim" to "" is either > > necessary, or a good thing, but, whatever.... > > i covered that here: > https://sourceware.org/pipermail/gdb/2021-January/049098.html > https://sourceware.org/pipermail/gdb-patches/2021-January/175115.html > > > For gdb we have a 'gdb_init' proc, which is called based on > > '${tool}_init' from within GDB. Now that we have no tool set does > > this prevent us having an 'init' proc? > > it does not mean that. we have `sim_init` in lib/sim-defs.exp and it is > still called via config/default.exp. > > (i'll delete the part of your email below that talks about not having it) > > > Lets assume for one moment that we _did_ have an init proc. Could > > that proc not just have one huge [istarget ???] { set arch ... } tree > > that handled all known istarget patterns? > > we could do that. i don't think that's better than what i'm proposing > with setting the arch in the / subdirs. it seems slightly worse > because the [istarget ???] patterns that we use in the / subdirs > need to be replicated -- some have a 1-to-many map of arch-to-targets. > although we can prob have the centralized logic use target mappings that > capture more than necessary as long as it's still unique between each > other. e.g. we can glob cris* even though the cris port itself uses > cris-*-* & crisv32-*-*. > > imo, this is the wrong direction: anytime we have a centralized place > where we have arch-specific logic, we're doing it wrong. we already > have a centralized list today that i want to move away from. the > sim/configure.tgt is setting up $arch based on the target. but it > doesn't work when doing multi-target (--enable-targets=all) because > there isn't a single port testsuite to bind to, hence it needs a new > home. > > > I think you say that right now we have pretty much one test script for > > each arch, but there's no reason which this has to be the case > > forever, right? > > correct. but i don't see how that's necessarily relevant to this thread. > even if we were to fragment the arch .exp files (somewhat akin to what > gdb does with some of its testsuites), we would still be able to have > each port share a common file (e.g. testsuite/bfin/common.exp) where we > could put the arch-specific settings. > > on a related note, imo, dejagnu is a dead end. Ian wrote a good post: > https://www.airs.com/blog/archives/499 > > but dejagnu is even more unnecessary for the sim as we have no need for > any of the target hooks. e.g. the ability for people to say "in order > to execute this program, copy the file to this remote system, then ssh > over to it, and run it like so". those are useful to gas, gdb, etc... > but would never be used by the sim. so really we should be looking at > throwing out dejagnu entirely from the sim and switching to something > like automake's builtin test runners. we use this in some projects in > the tree already when the test does not require any target execution. > > > It just seems weird to me to say that each test is required to start > > with a highly predictable bit of boiler plate... > > i don't disagree. but to be clear, i don't see any of this as the end > state long term. this is all intermediate steps for a better future. > sometimes that process means taking on a little tech debt to unblock > the next step, and then slowly collapsing that back as the common code > improves. so here we're taking a configure-time constant that locks > the testsuite to a single specific target and moving it to the tests. > then as we unify the sim ports into a single build, we'd delete the > setting from their testsuites in the process. Thanks for the explanation. I don't really understand what your end vision is. I don't agree that this is the right intermediate state to move to. Sure, sometimes things have to get worse before they can get better, but this feels like an even stronger argument for putting all of the "worse" into a single central location, rather than replicating it all over the place. ** BUT ** Given you clearly have more time for sim/ right now I think you should just commit this and move on, I suspect we're never going to agree on this one, and as its just an opinion thing I don't see the point in arguing it any further. If this ever causes problems in the future we just revisit this conversation at that point :) Thanks for taking to time to explain your position, I do appreciate it. Thanks, Andrew