From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Belohrad Newsgroups: gmane.emacs.help Subject: lisp file to modify contents of project Date: Fri, 11 Nov 2011 10:49:12 +0100 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001485f8f05ef41c3304b1726e5d X-Trace: dough.gmane.org 1321031577 9388 80.91.229.12 (11 Nov 2011 17:12:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 11 Nov 2011 17:12:57 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 11 18:12:54 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ROuer-0006Bi-F5 for geh-help-gnu-emacs@m.gmane.org; Fri, 11 Nov 2011 18:12:53 +0100 Original-Received: from localhost ([::1]:35805 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROuel-0007wg-Mo for geh-help-gnu-emacs@m.gmane.org; Fri, 11 Nov 2011 12:12:47 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:33291) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROnjd-0003aM-EK for help-gnu-emacs@gnu.org; Fri, 11 Nov 2011 04:49:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROnjb-0003Th-PD for help-gnu-emacs@gnu.org; Fri, 11 Nov 2011 04:49:21 -0500 Original-Received: from mail05.solnet.ch ([212.101.4.139]:63433) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROnjb-0003T6-6o for help-gnu-emacs@gnu.org; Fri, 11 Nov 2011 04:49:19 -0500 Original-Received: from mail05.solnet.ch (localhost.solnet.ch [127.0.0.1]) by mail05.solnet.ch (Postfix) with ESMTP id 3B5873D62B for ; Fri, 11 Nov 2011 09:49:15 +0000 (UTC) X-Virus-Scanned: by SolNet-Check at mail05.solnet.ch Original-Received: from mail05.solnet.ch ([127.0.0.1]) by mail05.solnet.ch (mail05.solnet.ch [127.0.0.1]) (SolNet-Check, port 10024) with LMTP id LfDuZQ-N11yh for ; Fri, 11 Nov 2011 09:49:14 +0000 (UTC) Original-Received: from mail-vx0-f169.google.com (mail-vx0-f169.google.com [209.85.220.169]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by mail05.solnet.ch (Postfix) with ESMTPSA id BA1133D615 for ; Fri, 11 Nov 2011 09:49:13 +0000 (UTC) Original-Received: by vcbfo11 with SMTP id fo11so2553866vcb.0 for ; Fri, 11 Nov 2011 01:49:12 -0800 (PST) Original-Received: by 10.229.67.13 with SMTP id p13mr1664365qci.21.1321004952722; Fri, 11 Nov 2011 01:49:12 -0800 (PST) Original-Received: by 10.229.222.65 with HTTP; Fri, 11 Nov 2011 01:49:12 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: FreeBSD 6.x (1) X-Received-From: 212.101.4.139 X-Mailman-Approved-At: Fri, 11 Nov 2011 12:12:43 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:82862 Archived-At: --001485f8f05ef41c3304b1726e5d Content-Type: text/plain; charset=UTF-8 Dear All, i'm not very experienced with elisp/emacs so any help here appreciated. Imagine that I have VHDL project consisting of may VHDL files, like e.g. this one: ---------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; use work.Types.all; use work.bunch_storage.all; --! @brief bunch selection memory --! @details implements 128x32 memory to store info about all the bunches --! selected for the capture acquisition entity bunch_selection_memory is port (Clk120MHzxC : in std_logic; --! 120MHz clock Reset120MHzxRN : in std_logic; --! 120MHz synced reset NumberOfBunchSlotsxD : in positive; --! number of bunch slots derived from current timing and IsLHCTimingxS BSELVmeMemDxD : in VLong; --! 16 bit word input to the memory via VME interface and so on.......... ------------------------------------------------------------------- this VHDL project is however defined as well in not-only-VHDL-files, but as well e.g. mentor modelsim wave.do, containing commands like this one: ------------------------------------------------------------------- add wave -noupdate -expand -group dut -format Logic -radix hexadecimal /bunch_selection_memory_tb/dut/reset120mhzxrn ------------------------------------------------------------------- or quartus setting file, containing settings like this one: ------------------------------------------------------------------ set_location_assignment PIN_D11 -to Reset120MHzxRN ------------------------------------------------------------------ Now I came into situation, that I have to rename the Reset120MHzxRN signal into something completely different. So I was thinking just make dired of VHDL/SETTING/MODELSIM files, and just replace Reset120MHzxRN by another string. But I ran into troubles with caseness of the replace. I need that in the VHDL and quartus setting file the case stays _exactly_ as is, whereas in modelsim file I need to convert it into lowercase and replace only lowercase occurence by another lowercase occurence. I don't think it is possible to use dired mode for this - except that I do all the operation in two steps. Having quite a lot of these signals it is not really wise. So I was thinking, whether it is feasible to do some lisp code, which will: list all *.vhd, *.do, *.qsf from the project do all the replacements as shown above. is it feasible? the 'thing' i'm bit lost in is how to open make a list of files universally (independent of whether win/lin), and how to generate another buffer which would tell me what exactly in which file was changed -> something like diff mode any help appreciated.... thanks d. --001485f8f05ef41c3304b1726e5d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Dear All,

i'm not very experienced with elisp/emacs so any help = here appreciated.

Imagine that I have VHDL project consisting of may= VHDL files, like e.g. this one:

-----------------------------------= -----------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;<= br>use work.Types.all;
use work.bunch_storage.all;

--! @brief bun= ch selection memory
--! @details implements 128x32 memory to store info = about all the bunches
--! selected for the capture acquisition
entity bunch_selection_memory i= s
=C2=A0=C2=A0=C2=A0 port (Clk120MHzxC=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 : in=C2=A0 std_logic;= =C2=A0 --! 120MHz clock
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 Reset120MHzxRN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 : in=C2=A0 std_logic;=C2=A0 --! 120MHz synced reset
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 NumberOfBunchSlotsxD= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 : in=C2=A0 positive;=C2=A0 --! number of bun= ch slots derived from current timing and IsLHCTimingxS
=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 BSELVmeMemDxD=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 : in=C2=A0 VLong;=C2=A0= --! 16 bit word input to the memory via VME interface

and so on..........
------------------------------------------------= -------------------

this VHDL project is however defined as well in = not-only-VHDL-files, but as well e.g. mentor modelsim wave.do, containing c= ommands like this one:

-------------------------------------------------------------------
= add wave -noupdate -expand -group dut -format Logic -radix hexadecimal /bun= ch_selection_memory_tb/dut/reset120mhzxrn
------------------------------= -------------------------------------

or quartus setting file, containing settings like this one:

----= --------------------------------------------------------------
set_locat= ion_assignment PIN_D11 -to Reset120MHzxRN
------------------------------= ------------------------------------



Now I came into situation, that I have to rename the Reset120MH= zxRN signal into something completely different. So I was thinking just mak= e dired of VHDL/SETTING/MODELSIM files, and just replace Reset120MHzxRN by = another string. But I ran into troubles with caseness of the replace. I nee= d that in the VHDL and quartus setting file the case stays _exactly_ as is,= whereas in modelsim file I need to convert it into lowercase and replace o= nly lowercase occurence by another lowercase occurence.



I don't think it is possible to use dired mode for this - e= xcept that I do all the operation in two steps. Having quite a lot of these= signals it is not really wise. So I was thinking, whether it is feasible t= o do some lisp code, which will:

list all *.vhd, *.do, *.qsf from the project
do all the replacements= as shown above.


is it feasible? the 'thing' i'm bit= lost in is how to open make a list of files universally (independent of wh= ether win/lin), and how to generate another buffer which would tell me what= exactly in which file was changed -> something like diff mode


any help appreciated....

thanks
d.



--001485f8f05ef41c3304b1726e5d--