100DaysOfRTL icon indicating copy to clipboard operation
100DaysOfRTL copied to clipboard

Common makefile for each of the days

Open JayKaku opened this issue 2 years ago • 10 comments

Makefile is added to the main directory and tested for every case as discussed #3

JayKaku avatar Jun 29 '22 21:06 JayKaku

  • Sure we can move it back into the original directory but the command terminates, so I was wondering if it were necessary?
  • I'll look into day17 and yosys update

JayKaku avatar Jun 30 '22 18:06 JayKaku

So usually we would perform the following commands one after the another:

  • make compile
  • make sim
  • make synth

It would be helpful if we get back to the original directory right away and saves us the pain of doing cd..

raulbehl avatar Jul 02 '22 07:07 raulbehl

sry for the delay I was troubleshooting some issues with the destro in WSL2

  • So with this script itself, we can execute the cmds one after another without doing cd ..
  • commands look like make day=<number> compile or sim or synth or build or clean
  • I missed the modification in the compile cmd so I'll be adding it the next commit
  • I glanced through the change of the newer yosys version to look for changes, but I couldn't find any cmds being used here that need changes (please lemme know if you hand anything particular in mind)

Question

  • To tackle day17 dependencies I was thinking of either using if( $day == 17) ... or make day=17 deps=<day_numbers> ... which one shd be better?

JayKaku avatar Jul 04 '22 17:07 JayKaku

Hey @JayKaku, Apologies for the delay. I've been keeping busy.

So with this script itself, we can execute the cmds one after another without doing cd ..

Ah cool. Will give this a try then

I missed the modification in the compile cmd so I'll be adding it the next commit

Sounds good

I glanced through the change of the newer yosys version to look for changes, but I couldn't find any cmds being used here that need changes (please lemme know if you hand anything particular in mind)

Please check this link

To tackle day17 dependencies I was thinking of either using if( $day == 17) ... or make day=17 deps=<day_numbers> ... which one shd be better?

I'd recommend the if statement but that would introduce a lot more work for managing other such dependencies. I think it would be best to have the support provided using variables and let them be populated as command line args. We could add a README in each of the days to help with the additional options which need to be passed. How does that sound?

raulbehl avatar Jul 10 '22 07:07 raulbehl

Please check this link

Sure I'll look it up

I'd recommend the if statement but that would introduce a lot more work for managing other such dependencies. I think it would be best to have the support provided using variables and let them be populated as command line args. We could add a README in each of the days to help with the additional options which need to be passed. How does that sound?

True we need a lot of maintenance of the makerfile with if statements, we'll go the cmd line args and vars route

JayKaku avatar Jul 10 '22 09:07 JayKaku

Hey @raulbehl , apologies for the delay, I've been keeping busy with internship and college together.

So I went through the repo once again and found that in the file day 20 there are 7 dependencies so if we create a common makefile wherein the user has to type in all the DEPS in the cmd line, it'll become a lot of extra effort for anyone to type those out just to view a simple simulation.

So I was thinking to include "../dayX/dayX.sv" in the design itself like this:

// A useless system (day20)
`include "../day14/day14.sv"
`include "../day16/day16.sv"
`include "../day17/day17.sv"
`include "../day18/day18.sv"
`include "../day19/day19.sv"
`include "../day3/day3.sv"
`include "../day7/day7.sv"

So this might maybe be a better way out for having a common makefile . Hoping to know your thoughts on it, Thanks.

JayKaku avatar Aug 07 '22 03:08 JayKaku

Hey, @JayKaku, It is not a common practice to include design files but I think it should be fine.

raulbehl avatar Aug 07 '22 07:08 raulbehl

Just to clarify if I got it right, it should be fine to have include included in design sv files? Also, I am curious to know if is there a reason for this common practice that I might've overlooked, thanks

JayKaku avatar Aug 07 '22 15:08 JayKaku

Yes, it should be fine and the reason why it isn't a common practice is because once the module is compiled you are free to instantiate it without an explicit `include. That is pretty much redundant.

raulbehl avatar Aug 07 '22 18:08 raulbehl

Yes, that makes things a lot more clear 👍

JayKaku avatar Aug 07 '22 21:08 JayKaku

Hi @JayKaku, Thank you for the efforts in trying to get this in but unfortunately the Makefiles have gotten specific to the content covered each day. Hence I believe it would be challenging to have a common Makefile and doesn't really help ease the setup.

raulbehl avatar Feb 04 '23 11:02 raulbehl