How's your Spanish? Here's a list of some recommened biking routes in Spain. You can use google translate or something similar if needed:
https://elviajero.elpais.com/elviaje...70_186925.html
My favorite area in Portugal was the Douro valley. The Minho valley was nice, too. There was a bike path right along the northern border of Portugal along the Minho river.
My touring in Spain was all in the northern third of the country. There is very little flat land in either country.
If you do a search in the Touring forum, you'll find plenty of past discussions about touring in both countries.